zeromq / php-zmq

ZeroMQ for PHP
http://pecl.php.net/zmq
Other
550 stars 118 forks source link

Installation fails on PHP 8.2.12 on macOS M1 #235

Open tsegreto opened 4 months ago

tsegreto commented 4 months ago

I'v been trying to install ZMQ on macOS with PHP 8.2.12 on my M1 but I am met with this:

pecl install zmq-beta
downloading zmq-1.1.3.tgz ...
Starting to download zmq-1.1.3.tgz (82,397 bytes)
....................done: 82,397 bytes
24 source files, building
running: phpize
Configuring for:
PHP Api Version:         20220829
Zend Module Api No:      20220829
Zend Extension Api No:   420220829
Please provide the prefix of libzmq installation [autodetect] : 
building in /private/tmp/pear/temp/pear-build-tsQJJm5z/zmq-1.1.3
running: /private/tmp/pear/temp/zmq/configure --with-php-config=/opt/homebrew/opt/php/bin/php-config --with-zmq
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /opt/homebrew/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... aarch64-apple-darwin23.3.0
checking host system type... aarch64-apple-darwin23.3.0
checking target system type... aarch64-apple-darwin23.3.0
checking for PHP prefix... /opt/homebrew/Cellar/php/8.2.12_1
checking for PHP includes... -I/opt/homebrew/Cellar/php/8.2.12_1/include/php -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/main -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/TSRM -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/Zend -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/ext -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/ext/date/lib
checking for PHP extension directory... /opt/homebrew/Cellar/php/8.2.12_1/pecl/20220829
checking for PHP installed headers prefix... /opt/homebrew/Cellar/php/8.2.12_1/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable 0MQ support... yes, shared
checking whether to enable CZMQ support... no
checking for pkg-config... /opt/homebrew/bin/pkg-config
checking libzmq installation... found version 4.3.5, under /opt/homebrew/Cellar/zeromq/4.3.5_1
checking for zmq_socket_monitor in -lzmq... yes
checking for zmq_proxy_steerable in -lzmq... yes
checking for zmq_z85_decode in -lzmq... yes
checking for zmq_curve_keypair in -lzmq... yes
checking for zmq_ctx_get in -lzmq... yes
checking for zmq_unbind in -lzmq... yes
checking for zmq_disconnect in -lzmq... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for stdint.h... (cached) yes
checking for time.h... yes
checking for sys/time.h... yes
checking for mach/mach_time.h... yes
checking for library containing clock_gettime... none required
checking for clock_gettime... yes
checking for gettimeofday... yes
checking for mach_absolute_time... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by cc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 786432
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... ld: warning: -single_module is obsolete
yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin23.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/temp/pear-build-tsQJJm5z/zmq-1.1.3/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/zmq -I/private/tmp/pear/temp/pear-build-tsQJJm5z/zmq-1.1.3/include -I/private/tmp/pear/temp/pear-build-tsQJJm5z/zmq-1.1.3/main -I/private/tmp/pear/temp/zmq -I/opt/homebrew/Cellar/php/8.2.12_1/include/php -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/main -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/TSRM -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/Zend -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/ext -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/ext/date/lib -I/opt/homebrew/Cellar/zeromq/4.3.5_1/include -I/opt/homebrew/Cellar/libsodium/1.0.19/include  -DHAVE_CONFIG_H  -g -O2 -D_GNU_SOURCE    -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/zmq/zmq.c -o zmq.lo  -MMD -MF zmq.dep -MT zmq.lo
mkdir .libs
 cc -I. -I/private/tmp/pear/temp/zmq -I/private/tmp/pear/temp/pear-build-tsQJJm5z/zmq-1.1.3/include -I/private/tmp/pear/temp/pear-build-tsQJJm5z/zmq-1.1.3/main -I/private/tmp/pear/temp/zmq -I/opt/homebrew/Cellar/php/8.2.12_1/include/php -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/main -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/TSRM -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/Zend -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/ext -I/opt/homebrew/Cellar/php/8.2.12_1/include/php/ext/date/lib -I/opt/homebrew/Cellar/zeromq/4.3.5_1/include -I/opt/homebrew/Cellar/libsodium/1.0.19/include -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/zmq/zmq.c -MMD -MF zmq.dep -MT zmq.lo  -fno-common -DPIC -o .libs/zmq.o
/private/tmp/pear/temp/zmq/zmq.c:210:50: warning: format specifies type 'long' but the argument has type 'zend_long' (aka 'long long') [-Wformat]
                plist_key = strpprintf(0, "zmq_context=[%ld]", io_threads);
                                                        ~~~    ^~~~~~~~~~
                                                        %lld
/private/tmp/pear/temp/zmq/zmq.c:238:20: error: expression is not assignable
                GC_REFCOUNT(&le) = 1;
                ~~~~~~~~~~~~~~~~ ^
/private/tmp/pear/temp/zmq/zmq.c:526:53: warning: format specifies type 'long' but the argument has type 'zend_long' (aka 'long long') [-Wformat]
        return strpprintf(0, "zmq_socket:[%ld]-[%s]-[%d]", type, persistent_id->val, use_shared_ctx);
                                          ~~~              ^~~~
                                          %lld
/private/tmp/pear/temp/zmq/zmq.c:538:19: error: expression is not assignable
        GC_REFCOUNT(&le) = 1;
        ~~~~~~~~~~~~~~~~ ^
/private/tmp/pear/temp/zmq/zmq.c:616:7: error: no member named 'no_separation' in 'struct _zend_fcall_info'
        fci->no_separation  = 1;
        ~~~  ^
/private/tmp/pear/temp/zmq/zmq.c:656:2: error: expected ')'
        PHP_ZMQ_ERROR_HANDLING_THROW()
        ^
/private/tmp/pear/temp/zmq/php_zmq_private.h:159:129: note: expanded from macro 'PHP_ZMQ_ERROR_HANDLING_THROW'
#define PHP_ZMQ_ERROR_HANDLING_THROW() zend_replace_error_handling(EH_THROW, php_zmq_socket_exception_sc_entry, &error_handling TSRMLS_CC);
                                                                                                                                ^
/private/tmp/pear/temp/zmq/zmq.c:656:2: note: to match this '('
/private/tmp/pear/temp/zmq/php_zmq_private.h:159:67: note: expanded from macro 'PHP_ZMQ_ERROR_HANDLING_THROW'
#define PHP_ZMQ_ERROR_HANDLING_THROW() zend_replace_error_handling(EH_THROW, php_zmq_socket_exception_sc_entry, &error_handling TSRMLS_CC);
                                                                  ^
/private/tmp/pear/temp/zmq/zmq.c:661:2: error: expected ')'
        PHP_ZMQ_ERROR_HANDLING_RESTORE()
        ^
/private/tmp/pear/temp/zmq/php_zmq_private.h:161:86: note: expanded from macro 'PHP_ZMQ_ERROR_HANDLING_RESTORE'
#define PHP_ZMQ_ERROR_HANDLING_RESTORE() zend_restore_error_handling(&error_handling TSRMLS_CC);
                                                                                     ^
/private/tmp/pear/temp/zmq/zmq.c:661:2: note: to match this '('
/private/tmp/pear/temp/zmq/php_zmq_private.h:161:69: note: expanded from macro 'PHP_ZMQ_ERROR_HANDLING_RESTORE'
#define PHP_ZMQ_ERROR_HANDLING_RESTORE() zend_restore_error_handling(&error_handling TSRMLS_CC);
                                                                    ^
/private/tmp/pear/temp/zmq/zmq.c:749:2: error: expected ')'
        PHP_ZMQ_ERROR_HANDLING_THROW()
        ^
/private/tmp/pear/temp/zmq/php_zmq_private.h:159:129: note: expanded from macro 'PHP_ZMQ_ERROR_HANDLING_THROW'
#define PHP_ZMQ_ERROR_HANDLING_THROW() zend_replace_error_handling(EH_THROW, php_zmq_socket_exception_sc_entry, &error_handling TSRMLS_CC);
                                                                                                                                ^
/private/tmp/pear/temp/zmq/zmq.c:749:2: note: to match this '('
/private/tmp/pear/temp/zmq/php_zmq_private.h:159:67: note: expanded from macro 'PHP_ZMQ_ERROR_HANDLING_THROW'
#define PHP_ZMQ_ERROR_HANDLING_THROW() zend_replace_error_handling(EH_THROW, php_zmq_socket_exception_sc_entry, &error_handling TSRMLS_CC);
                                                                  ^
/private/tmp/pear/temp/zmq/zmq.c:754:2: error: expected ')'
        PHP_ZMQ_ERROR_HANDLING_RESTORE()
        ^
/private/tmp/pear/temp/zmq/php_zmq_private.h:161:86: note: expanded from macro 'PHP_ZMQ_ERROR_HANDLING_RESTORE'
#define PHP_ZMQ_ERROR_HANDLING_RESTORE() zend_restore_error_handling(&error_handling TSRMLS_CC);
                                                                                     ^
/private/tmp/pear/temp/zmq/zmq.c:754:2: note: to match this '('
/private/tmp/pear/temp/zmq/php_zmq_private.h:161:69: note: expanded from macro 'PHP_ZMQ_ERROR_HANDLING_RESTORE'
#define PHP_ZMQ_ERROR_HANDLING_RESTORE() zend_restore_error_handling(&error_handling TSRMLS_CC);
                                                                    ^
/private/tmp/pear/temp/zmq/zmq.c:1514:36: warning: passing arguments to 'php_zmq_pollset_errors' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
        RETVAL_ZVAL(php_zmq_pollset_errors(intern->set), 1, 0);
                                          ^
3 warnings and 7 errors generated.
make: *** [zmq.lo] Error 1
ERROR: `make' failed
tsegreto commented 4 months ago

Seems to be the same issue: #220

tsegreto commented 4 months ago

Seems to be the same issue as #217 as well

Krysa97 commented 2 months ago

Same problem but only way what work for me is build it from binary $ git clone git@github.com:zeromq/php-zmq.git $ cd php-zmq $ phpize && ./configure $ make && make install

After that add extension to php.ini extension=/..PATH_TO../php-zmq/modules/zmq.so