• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved How to install Zeromq

a.prevost

New Pleskian
Hello,

I am trying to install the zeromq extension on plesk onyx, but I can not do it.
I have been looking for a few days, but to no avail.

My plesk is installed on Centos7,
I think I managed to install it at the root, but I can not find it in the php extensions on plesk.

I have not found a specific tutorial on this subject, if someone can help me Or if someone knows a detailed tutorial

PS: sorry for my english, i'm french ;-)
 
Please try to use following steps for installing zmq php extension:

# yum install plesk-php71-devel gcc make
# wget https://github.com/zeromq/libzmq/releases/download/v4.2.3/zeromq-4.2.3.tar.gz
# tar -xzf zeromq-4.2.3.tar.gz
# cd zeromq-4.2.3/
# ./configure --prefix=/usr
# make
# make install
# /opt/plesk/php/7.1/bin/pecl install zmq-beta
# echo "extension=zmq.so" > /opt/plesk/php/7.1/etc/php.d/zmq.ini
# cp /usr/lib/libzmq.so.5 /usr/lib64/
# plesk bin php_handler --reread

After that check that zmq php extension is successfully loaded:

# /opt/plesk/php/7.1/bin/php -m | grep zmq
zmq
 
Hello,

You are my savior !!

I looked a little, because it did not work, but it must be due to my previous tests. but after uninstalling the previous versions I tried to install it works now thanks to you !!!

Really, thank you !!!
 
I have a PHP warning:
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/plesk/php/7.1/lib/php/modules/zmq.so' - /opt/plesk/php/7.1/lib/php/modules/zmq.so: cannot open shared object file: No such file or directory in Unknown on line 0

How fix it?
Thanks!
 
I have a PHP warning:
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/plesk/php/7.1/lib/php/modules/zmq.so' - /opt/plesk/php/7.1/lib/php/modules/zmq.so: cannot open shared object file: No such file or directory in Unknown on line 0

How fix it?
Thanks!
Have you installed the module according to instruction Resolved - How to install Zeromq ? Do you really have /opt/plesk/php/7.1/lib/php/modules/zmq.so file there?
 
Please try to use following steps for installing zmq php extension:

# yum install plesk-php71-devel gcc make
# wget https://github.com/zeromq/libzmq/releases/download/v4.2.3/zeromq-4.2.3.tar.gz
# tar -xzf zeromq-4.2.3.tar.gz
# cd zeromq-4.2.3/
# ./configure --prefix=/usr
# make
# make install
# /opt/plesk/php/7.1/bin/pecl install zmq-beta
# echo "extension=zmq.so" > /opt/plesk/php/7.1/etc/php.d/zmq.ini
# cp /usr/lib/libzmq.so.5 /usr/lib64/
# plesk bin php_handler --reread

After that check that zmq php extension is successfully loaded:

# /opt/plesk/php/7.1/bin/php -m | grep zmq
zmq
I tried this on ubuntu setup
ran first command as sudo apt install plesk-php73-dev

line ./configure --prefix=/usr gives following error
configure: error: Unable to find a working C++ compiler
 
I tried this on ubuntu setup
ran first command as sudo apt install plesk-php73-dev

line ./configure --prefix=/usr gives following error
configure: error: Unable to find a working C++ compiler
Why only plesk-php73-dev? What about necessary make and gcc?
 
All commands in my instruction above were executed under root account (see # prompt).
So, you can login as root or use sudo.
 
command sudo /opt/plesk/php/7.3/bin/pecl install zmq-beta
fails with
Code:
/bin/bash /tmp/pear-build-rootmvU0Xc/zmq-1.1.3/libtool --mode=compile cc  -I. -I/tmp/zmq -DPHP_ATOM_INC -I/tmp/pear-build-rootmvU0Xc/zmq-1.1.3/include -I/tmp/pear-build-roo
tmvU0Xc/zmq-1.1.3/main -I/tmp/zmq -I/opt/plesk/php/7.3/include/php -I/opt/plesk/php/7.3/include/php/main -I/opt/plesk/php/7.3/include/php/TSRM -I/opt/plesk/php/7.3/include/
php/Zend -I/opt/plesk/php/7.3/include/php/ext -I/opt/plesk/php/7.3/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/zmq/zmq.c -o zmq.lo                          
libtool: compile:  cc -I. -I/tmp/zmq -DPHP_ATOM_INC -I/tmp/pear-build-rootmvU0Xc/zmq-1.1.3/include -I/tmp/pear-build-rootmvU0Xc/zmq-1.1.3/main -I/tmp/zmq -I/opt/plesk/php/7
.3/include/php -I/opt/plesk/php/7.3/include/php/main -I/opt/plesk/php/7.3/include/php/TSRM -I/opt/plesk/php/7.3/include/php/Zend -I/opt/plesk/php/7.3/include/php/ext -I/opt
/plesk/php/7.3/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/zmq/zmq.c  -fPIC -DPIC -o .libs/zmq.o                                                                
/tmp/zmq/zmq.c: In function ‘php_zmq_context_get’:                                                                                                                          
/tmp/zmq/zmq.c:238:20: error: lvalue required as left operand of assignment                                                                                                 
   GC_REFCOUNT(&le) = 1;                                                                                                                                                    
                    ^                                                                                                                                                       
/tmp/zmq/zmq.c: In function ‘php_zmq_socket_store’:                                                                                                                         
/tmp/zmq/zmq.c:538:19: error: lvalue required as left operand of assignment                                                                                                 
  GC_REFCOUNT(&le) = 1;                                                                                                                                                     
                   ^                                                                                                                                                        
Makefile:194: recipe for target 'zmq.lo' failed                                                                                                                             
make: *** [zmq.lo] Error 1                                                                                                                                                  
ERROR: `make' failed
 
Try to use my instruction step-by-step after login as root (without sudo).
 
I am using zeromq-4.3.4 that should not be a problem right?
No, I successfully compiled zeromq-4.3.4 on Ubuntu with:

Code:
# apt install build-essential
# wget https://github.com/zeromq/libzmq/releases/download/v4.3.4/zeromq-4.3.4.tar.gz
# tar -xzf zeromq-4.3.4.tar.gz
# cd zeromq-4.3.4/
# ./configure --prefix=/usr
# make
# make install

But there is a problem on the stage of compiling PHP module with the pecl:

Code:
# /opt/plesk/php/7.3/bin/pecl install zmq-beta
........
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear-build-root59MXHq/zmq-1.1.3/libtool --mode=compile cc  -I. -I/tmp/zmq -DPHP_ATOM_INC -I/tmp/pear-build-root59MXHq/zmq-1.1.3/include -I/tmp/pear-build-root59MXHq/zmq-1.1.3/main -I/tmp/zmq -I/opt/plesk/php/7.3/include/php -I/opt/plesk/php/7.3/include/php/main -I/opt/plesk/php/7.3/include/php/TSRM -I/opt/plesk/php/7.3/include/php/Zend -I/opt/plesk/php/7.3/include/php/ext -I/opt/plesk/php/7.3/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/zmq/zmq.c -o zmq.lo
libtool: compile:  cc -I. -I/tmp/zmq -DPHP_ATOM_INC -I/tmp/pear-build-root59MXHq/zmq-1.1.3/include -I/tmp/pear-build-root59MXHq/zmq-1.1.3/main -I/tmp/zmq -I/opt/plesk/php/7.3/include/php -I/opt/plesk/php/7.3/include/php/main -I/opt/plesk/php/7.3/include/php/TSRM -I/opt/plesk/php/7.3/include/php/Zend -I/opt/plesk/php/7.3/include/php/ext -I/opt/plesk/php/7.3/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/zmq/zmq.c  -fPIC -DPIC -o .libs/zmq.o
/tmp/zmq/zmq.c: In function ‘php_zmq_context_get’:
/tmp/zmq/zmq.c:238:20: error: lvalue required as left operand of assignment
  238 |   GC_REFCOUNT(&le) = 1;
      |                    ^
/tmp/zmq/zmq.c: In function ‘php_zmq_socket_store’:
/tmp/zmq/zmq.c:538:19: error: lvalue required as left operand of assignment
  538 |  GC_REFCOUNT(&le) = 1;
      |                   ^
make: *** [Makefile:194: zmq.lo] Error 1
ERROR: `make' failed

Looks like some kind of incompatibility.
 
I tried with the same result of compiling PHP module.
Strange but it works fine on CentOS but not on Ubuntu/Debian.
Damn we need this module to go live in next few days.
hope this can be resolved by some means.
will updating to php7.4 help?
 
Damn we need this module to go live in next few days.
I found a solution. You have to compile PHP module from the master branch:

# apt-get install --yes git libzmq3-dev
# git clone git://github.com/mkoppanen/php-zmq.git
# cd php-zmq/
# /opt/plesk/php/7.3/bin/phpize
# ./configure --with-php-config=/opt/plesk/php/7.3/bin/php-config
# make
# make install
# echo "extension=zmq.so" > /opt/plesk/php/7.3/etc/php.d/zmq.ini
# plesk bin php_handler --reread

As result:

# /opt/plesk/php/7.3/bin/php -m | grep zmq
zmq
 
Back
Top