How to install ZeroMQ with PHP binding on Ubuntu 11.10

By Alexander van Noord on

Some version numbers:

Make sure you have all the packages:

sudo apt-get install build-essential libtool autoconf 
\ uuid-dev php5 php5-dev pkg-config git

Installing ZeroMQ:

tar -xvzf zeromq-2.1.11.tar.gz
cd zeromq-2.1.11.tar.gz
sudo make install
sudo ldconfig

Installing the PHP binding:

git clone git://
cd php-zmq
phpize && ./configure
sudo make install

And finally add the following line to your /etc/php5/(apache2|cli)/php.ini:

Testing if it works, add this to zmq.php:

<?php var_dump(class_exists('ZMQContext')); ?>

And run:

php zmq.php