docker-library / php

Docker Official Image packaging for PHP
https://php.net
MIT License
3.84k stars 2k forks source link

Alpine and install zmq #1413

Closed krajcikondra closed 1 year ago

krajcikondra commented 1 year ago

Hi,

I am trying install php zmq extension by this commands

FROM php:8.2.6-alpine
....
RUN apk add autoconf gcc libzmq zeromq-dev zeromq coreutils build-base
RUN pecl install zmq-beta
RUN docker-php-ext-enable zmq

But I get following error:

#0 6.270 /tmp/pear/temp/zmq/zmq.c:656:9: note: in expansion of macro 'PHP_ZMQ_ERROR_HANDLING_THROW'
#0 6.270   656 |         PHP_ZMQ_ERROR_HANDLING_THROW()
#0 6.270       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#0 6.270 /tmp/pear/temp/zmq/php_zmq_private.h:161:86: error: expected ')' before 'TSRMLS_CC'
#0 6.270   161 | #define PHP_ZMQ_ERROR_HANDLING_RESTORE() zend_restore_error_handling(&error_handling TSRMLS_CC);
#0 6.270       |                                                                     ~                ^~~~~~~~~
#0 6.270 /tmp/pear/temp/zmq/zmq.c:661:9: note: in expansion of macro 'PHP_ZMQ_ERROR_HANDLING_RESTORE'
#0 6.270   661 |         PHP_ZMQ_ERROR_HANDLING_RESTORE()
#0 6.270       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#0 6.271 /tmp/pear/temp/zmq/zmq.c: In function 'zim_zmqsocket___construct':
#0 6.271 /tmp/pear/temp/zmq/php_zmq_private.h:159:129: error: expected ')' before 'TSRMLS_CC'
#0 6.271   159 | #define PHP_ZMQ_ERROR_HANDLING_THROW() zend_replace_error_handling(EH_THROW, php_zmq_socket_exception_sc_entry, &error_handling TSRMLS_CC);
#0 6.271       |                                                                   ~                                                             ^~~~~~~~~
#0 6.271 /tmp/pear/temp/zmq/zmq.c:749:9: note: in expansion of macro 'PHP_ZMQ_ERROR_HANDLING_THROW'
#0 6.271   749 |         PHP_ZMQ_ERROR_HANDLING_THROW()
#0 6.271       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#0 6.271 /tmp/pear/temp/zmq/php_zmq_private.h:161:86: error: expected ')' before 'TSRMLS_CC'
#0 6.271   161 | #define PHP_ZMQ_ERROR_HANDLING_RESTORE() zend_restore_error_handling(&error_handling TSRMLS_CC);
#0 6.271       |                                                                     ~                ^~~~~~~~~
#0 6.271 /tmp/pear/temp/zmq/zmq.c:754:9: note: in expansion of macro 'PHP_ZMQ_ERROR_HANDLING_RESTORE'
#0 6.271   754 |         PHP_ZMQ_ERROR_HANDLING_RESTORE()
#0 6.271       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#0 6.319 make: *** [Makefile:210: zmq.lo] Error 1
#0 6.320 ERROR: `make' failed
------
Dockerfile:69
--------------------
  67 |     
  68 |     RUN apk add autoconf gcc libzmq zeromq-dev zeromq coreutils build-base
  69 | >>> RUN pecl install zmq-beta
  70 |     RUN docker-php-ext-enable zmq
  71 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c pecl install zmq-beta" did not complete successfully: exit code: 1

Know somebody how fix this error?

Thanks

tianon commented 1 year ago

Oof, https://pecl.php.net/package/zmq has a big bold "This package is not maintained" banner and hasn't been updated since 2016 :grimacing:

That being said, it does look like https://github.com/zeromq/php-zmq has had more recent commits, with the most recent apparently related to PHP 8.2 support, so perhaps you'll have better luck pinning to a particular commit there?

(Closing since this isn't really an issue with the PHP image :heart:)