mgdm / Mosquitto-PHP

A wrapper for the Eclipse Mosquitto™ MQTT client library for PHP.
BSD 3-Clause "New" or "Revised" License
528 stars 146 forks source link

Mosquitto-PHP does not build on Ubuntu 22.04 for php8 #128

Open Siggemada opened 1 year ago

Siggemada commented 1 year ago

Am I missing some dependency?

I did:

git checkout php8 git pull phpize ./configure --with-mosquitto=/usr/include make

And I am on ubuntu 22.04.1 freshly installed.

`~/Mosquitto-PHP$ make /bin/bash /home/user/Mosquitto-PHP/libtool --mode=compile cc -I. -I/home/user/Mosquitto-PHP -I/home/user/Mosquitto-PHP/include -I/home/user/Mosquitto-PHP/main -I/home/user/Mosquitto-PHP -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -DHAVE_CONFIG_H -g -O2 -DZEND_COMPILE_DL_EXT=1 -c /home/user/Mosquitto-PHP/mosquitto.c -o mosquitto.lo -MMD -MF mosquitto.dep -MT mosquitto.lo libtool: compile: cc -I. -I/home/user/Mosquitto-PHP -I/home/user/Mosquitto-PHP/include -I/home/user/Mosquitto-PHP/main -I/home/user/Mosquitto-PHP -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -DHAVE_CONFIG_H -g -O2 -DZEND_COMPILE_DL_EXT=1 -c /home/user/Mosquitto-PHP/mosquitto.c -MMD -MF mosquitto.dep -MT mosquitto.lo -fPIC -DPIC -o .libs/mosquitto.o /home/user/Mosquitto-PHP/mosquitto.c: In function ‘zim_Mosquitto_Client_setTlsCertificates’: /home/user/Mosquitto-PHP/mosquitto.c:234:18: warning: passing argument 1 of ‘php_stat’ from incompatible pointer type [-Wincompatible-pointer-types] 234 php_stat(ca_path, ca_path_len, FS_IS_DIR, &stat); ^~~
char *
In file included from /home/user/Mosquitto-PHP/mosquitto.c:10: /usr/include/php/20210902/ext/standard/php_filestat.h:44:35: note: expected ‘zend_string ’ {aka ‘struct _zend_string ’} but argument is of type ‘char *’ 44 PHPAPI void php_stat(zend_string filename, int type, zval return_value); ~~~^~ /usr/include/php/20210902/ext/standard/php_filestat.h:60:20: warning: passing argument 3 of ‘php_stat’ makes pointer from integer without a cast [-Wint-conversion] 60 #define FS_IS_DIR 13 ^~
int

/home/user/Mosquitto-PHP/mosquitto.c:234:40: note: in expansion of macro ‘FS_IS_DIR’ 234 | php_stat(ca_path, ca_path_len, FS_IS_DIR, &stat); | ^~~~~ /usr/include/php/20210902/ext/standard/php_filestat.h:44:61: note: expected ‘zval ’ {aka ‘struct _zval_struct ’} but argument is of type ‘int’ 44 | PHPAPI void php_stat(zend_string filename, int type, zval return_value); | ~~^~~~ /home/user/Mosquitto-PHP/mosquitto.c:234:9: error: too many arguments to function ‘php_stat’ 234 | php_stat(ca_path, ca_path_len, FS_IS_DIR, &stat); | ^~~~ In file included from /home/user/Mosquitto-PHP/mosquitto.c:10: /usr/include/php/20210902/ext/standard/php_filestat.h:44:13: note: declared here 44 | PHPAPI void php_stat(zend_string filename, int type, zval return_value); | ^~~~ make: *** [Makefile:202: mosquitto.lo] Error 1 `

Siggemada commented 1 year ago

Ok, wrong repro. I used: https://github.com/nismoryco/Mosquitto-PHP instead and that worked fine.