← ServerPilot Docs

How to Install the PHP ZeroMQ Extension

In the examples shown, replace "X.Y" with your app's PHP version (for example, "5.6" or "7.0"). To install this extension for multiple PHP versions, repeat the installation for each PHP version.

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. It does not yet support PHP 7.3.

Install the PHP ZeroMQ Extension

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

Verify the Installation

You can verify the ZeroMQ extension is installed by running this command:

phpX.Y-sp -i | grep zmq

You should see the following output:

libzmq version => 2.2.0

Uninstalling the ZeroMQ Extension

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
Last updated: October 8, 2018

Launch your first site in 5 minutes