The PHP ZeroMQ extension provides PHP functions for using the ZeroMQ communication library.
The ZeroMQ extension supports PHP 5.4, 5.5, 5.6, 7.0, 7.1, and 7.2.
To install this extension, SSH in to your server as root and run the following commands:
sudo apt-get -y install gcc make autoconf pkg-config
On Ubuntu 12.04, 14.04, and 16.04:
sudo apt-get -y install libzmq-dev
On Ubuntu 18.04:
sudo apt-get -y install libzmq3-dev
Next run the command:
sudo peclX.Y-sp install zmq-beta
Press enter when prompted with Please provide the prefix of libzmq installation [autodetect] :.
Finally, complete the installation by running these commands as root:
sudo bash -c "echo extension=zmq.so > /etc/phpX.Y-sp/conf.d/zmq.ini" sudo service phpX.Y-fpm-sp restart
You can verify the ZeroMQ extension is installed by running this command:
phpX.Y-sp -i | grep zmq
You should see the following output:
/etc/phpX.Y-sp/conf.d/zmq.ini zmq libzmq version => 2.2.0
To uninstall this extension, as root run the commands:
sudo rm /etc/phpX.Y-sp/conf.d/zmq.ini sudo peclX.Y-sp uninstall zmq
Next, restart PHP-FPM with the command:
sudo service phpX.Y-fpm-sp restart