https://github.com/mkoppanen/php-zmq
一、安装zeromq
1. wget ‘http://download.zeromq.org/zeromq-3.2.1-rc2.tar.gz’
2. tar zxvf zeromq-3.2.1-rc2.tar.gz
3. cd zeromq-3.2.1
4. ./configure –prefix=/usr/local/zeromq
5. make
6. sudo make install
二、安装php扩展
1. wget ‘https://github.com/mkoppanen/php-zmq/zipball/master’
2. unzip mkoppanen-php-zmq-1.0.3-16-g2bfa4c8.zip
3. cd mkoppanen-php-zmq-2bfa4c8
4. phpize
5. ./configure –with-php-config=/usr/local/php/bin/php-config –with-zmq=/usr/local/zeromq
6. make
7. sudo make install
8. sudo vim /usr/local/php/etc/php.ini
extension=zmq.so
三、测试
1. 运行server php examples/simple-server.php
2. 运行client php examples/client.php
检测是否安装了扩展
# php -i | grep libzmq
libzmq version => 4.1.2
来源: CentOS 下安装 zeromq 及其php扩展安装 – lkernel的专栏 – 博客频道 – CSDN.NET