Mosquitto-PHP icon indicating copy to clipboard operation
Mosquitto-PHP copied to clipboard

Is php8.2 supported?

Open maclechan opened this issue 1 year ago • 3 comments

/bin/sh /Users/maclechan/website/Mosquitto-PHP/libtool --tag=CC --mode=compile cc -I. -I/Users/maclechan/website/Mosquitto-PHP -I/Users/maclechan/website/Mosquitto-PHP/include -I/Users/maclechan/website/Mosquitto-PHP/main -I/Users/maclechan/website/Mosquitto-PHP -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /Users/maclechan/website/Mosquitto-PHP/mosquitto.c -o mosquitto.lo -MMD -MF mosquitto.dep -MT mosquitto.lo mkdir .libs cc -I. -I/Users/maclechan/website/Mosquitto-PHP -I/Users/maclechan/website/Mosquitto-PHP/include -I/Users/maclechan/website/Mosquitto-PHP/main -I/Users/maclechan/website/Mosquitto-PHP -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.2.25/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /Users/maclechan/website/Mosquitto-PHP/mosquitto.c -MMD -MF mosquitto.dep -MT mosquitto.lo -fno-common -DPIC -o .libs/mosquitto.o /Users/maclechan/website/Mosquitto-PHP/mosquitto.c:892:6: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion] ret = strerror_r(err, buf, 256); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [mosquitto.lo] Error 1

macos

maclechan avatar Oct 31 '24 09:10 maclechan

Are you using the php8 branch to build? In my Linux environment, I've successfully built it with PHP versions 8.1, 8.2, 8.3, and 8.4.

ryco-dev avatar Nov 01 '24 14:11 ryco-dev

I intend to move the copy the master branch to another one for older PHPs and merge that php8 branch, but I haven't quite got around to it yet. Then I'll remove anything that's different for PHP 5 and 7. Maybe I'll get into doing that this weekend.

mgdm avatar Nov 01 '24 14:11 mgdm

Are you using the php8 branch to build? In my Linux environment, I've successfully built it with PHP versions 8.1, 8.2, 8.3, and 8.4.

Yes. In my Macos(14.6) environment,I can't compile Mosquitto-php,and php verison is PHP 8.2.25.

maclechan avatar Nov 04 '24 03:11 maclechan

Build fails on Ubuntu Jammy (php 8.1) :

running: make
/bin/bash /tmp/pear/temp/pear-build-rootPdHHl6/Mosquitto-0.4.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/Mosquitto -I/tmp/pear/temp/pear-build-rootPdHHl6/Mosquitto-0.4.0/include -I/tmp/pear/temp/pear-build-rootPdHHl6/Mosquitto-0.4.0/main -I/tmp/pear/temp/Mosquitto -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 /tmp/pear/temp/Mosquitto/mosquitto.c -o mosquitto.lo  -MMD -MF mosquitto.dep -MT mosquitto.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/Mosquitto -I/tmp/pear/temp/pear-build-rootPdHHl6/Mosquitto-0.4.0/include -I/tmp/pear/temp/pear-build-rootPdHHl6/Mosquitto-0.4.0/main -I/tmp/pear/temp/Mosquitto -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 /tmp/pear/temp/Mosquitto/mosquitto.c -MMD -MF mosquitto.dep -MT mosquitto.lo  -fPIC -DPIC -o .libs/mosquitto.o
In file included from /tmp/pear/temp/Mosquitto/mosquitto.c:12:
/tmp/pear/temp/Mosquitto/php_mosquitto.h:118:95: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’
  118 | typedef int (*php_mosquitto_write_t)(mosquitto_message_object *mosquitto_object, zval *newval TSRMLS_DC);
      |                                                                                               ^~~~~~~~~
/tmp/pear/temp/Mosquitto/php_mosquitto.h:124:9: error: unknown type name ‘php_mosquitto_write_t’
  124 |         php_mosquitto_write_t write_func;
      |         ^~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/pear/temp/Mosquitto/mosquitto.c:12:
/tmp/pear/temp/Mosquitto/php_mosquitto.h:236:53: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’
  236 | void php_mosquitto_handle_errno(int retval, int err TSRMLS_DC);
      |                                                     ^~~~~~~~~
/tmp/pear/temp/Mosquitto/mosquitto.c:36:79: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’
   36 | static inline mosquitto_client_object *mosquitto_client_object_get(zval *zobj TSRMLS_DC) {
      |                                                                               ^~~~~~~~~

loxK avatar Oct 11 '25 03:10 loxK