zeromq / php-zmq

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

Class 'ZMQContext' not found in php-fpm #177

Open vschlemmer opened 8 years ago

vschlemmer commented 8 years ago

Hi guys, I have PHP 5.6 on Ubuntu 14.04 running with php-fpm and I have installed ZeroMQ 4.1.5 and the php binding via pear so it is compiled against my php version and added the extension=zmq.so line to /etc/php5/cli/php.ini as well as to /etc/php5/fpm/php.ini and restarted the server.

When I do php -m the zmq module is loaded but when I show phpinfo() via web, the module is not there and my zmq initialization script raises error saying "Class 'ZMQContext' not found". Do you have any idea why this is happening? Here is my question on StackOverflow: http://stackoverflow.com/questions/38054563/class-zmqcontext-not-found, so far not answered, there are just few different versions used there, but the problem exists with the newer versions too.

I have also tried to build the binding from github but without luck. Thanks in advance for any help, I'm stuck on this for days.

moukail commented 7 years ago

I have the same problem. when i do sudo /etc/init.d/php7.0-fpm restart

I get this error

Gracefully shutting down php-fpm . done
Starting php-fpm [13-Nov-2016 13:32:15] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20151012/zmq.so' - /usr/lib/php/extensions/no-debug-non-zts-20151012/zmq.so: undefined symbol: executor_globals in Unknown on line 0
<br />
<b>Warning</b>:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20151012/zmq.so' - /usr/lib/php/extensions/no-debug-non-zts-20151012/zmq.so: undefined symbol: executor_globals in <b>Unknown</b> on line <b>0</b><br />
Unknown(0) : Warning - PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20151012/zmq.so' - /usr/lib/php/extensions/no-debug-non-zts-20151012/zmq.so: undefined symbol: executor_globals
 done

phpize shows this

Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012

I have solved my problem when i just compile php 7 for fpm without using --enable-maintainer-zts and --enable-debug.

AnixPasBesoin commented 7 years ago

I'm having the same issue here. Zmq package doesn't seem to load (doesn't appear in phpinfo()). I'm using wamp. How have you managed to fix that?

xkungfu commented 4 years ago

same error... after "sudo apt-get install php-zmq"

for cli, it seems the file php.ini is redirected to "/etc/php/7.2/cli/", but my PHP is in other directory, not "/etc/php". for fpm, it seems nothing happened or be changed.

PHP version: 7.4.8 ubuntu 18.04 lnmp 1.7