In the previous section about technology selection of message-oriented middleware-RabbitMQ, ActiveMQ, and ZeroMQ, we introduced some related message queue software.
In the previous section about technology selection of message-oriented middleware-RabbitMQ, ActiveMQ, and ZeroMQ, we introduced some related message queue software. here we will introduce how to install zeromqq and how to use php.
Install zeromq Message Queue Software in centos.
1. install the server
123456 |
Cd ~ Wget http://download.zeromq.org/zeromq-3.2.3.tar.gztarzxvf zeromq-3.2.3.tar.gzcdzeromq-3.2.3./configure # -- prefix =/usr/local/zeromqmake & makeinstall |
2. install php extension
12345 |
Git clone git: // register |
After the execution, a message is displayed:
Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
The dynamic link library file zmq. so is generated. you can check whether zmq. so is in the directory.
If the prompt is displayed during make
Checking for pkg-config.../usr/bin/pkg-config
Checking libzmq installation... configure: error: Unable to find libzmq installation
You only need to cancel the-prefix of zeromq installation.
3. configure PHP. INI
Modify the/usr/loal/php/etc/php. ini file and add a line in the extension block.
And then restart php-fpm. use phpinfo () to check whether zmq's php extension has been installed successfully.
IV. instances
12 |
Cdphp-zmqmvexamples // usr/local/nginx/html/ |
Access http: // localhost/examples/client. php and you will see string (7) "Got it! "Indicates that the queue is successfully written.
Now you can check whether Port 5555 is listened on.
Php user manual reference: http://zguide.zeromq.org/php:all