Home  >  Article  >  Backend Development  >  zeromq installation ---php-zmq

zeromq installation ---php-zmq

WBOY
WBOYOriginal
2016-08-08 09:32:111235browse

Install zeromq

wget http://download.zeromq.org/zeromq-4.0.5.tar.gz
tar -zxvf zeromq-4.0.5.tar.gz
cd zeromq-4.0.5
cd foreign/openpgm/
tar -zxvf libpgm-5.2.122~dfsg.tar.gz
./configure --prefix=/data/klj/zeromq --with-pgm=libpgm-5.2.122~dfsg
make
make install

Install the php-zmq extension
git clone git://github.com/mkoppanen/php-zmq.git
cd php-zmq
/data/klj/php/bin/phpize
./configure --with-php- config=/data/klj/php/bin/php-config --with-zmq=/data/klj/zeromq
make && make install

Modify php.ini and restart

Error configure: error: Please reinstall the pkg-config distribution
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar -zxvf pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure --with-internal-glib
make && make install


ZMQ (hereinafter referred to as ZeroMQ) is a simple and easy-to-use transport layer, a socket library like a framework, which makes Socket programming simpler, more concise and more performant. Is a message processing queue library that elastically scales across multiple threads, cores, and host boxes. The clear goal of ZMQ is to "become part of the standard network protocol stack and then enter the Linux kernel.
Feature introduction:
ZMQ is not like a message queue server in the traditional sense. In fact, it is not a server at all. It is more like It is a bottom-level network communication library, which is encapsulated on top of the Socket API and abstracts network communication, process communication and thread communication into a unified API interface

Disadvantages:
zeroMq does not support message persistence and is prone to data loss.


Supports 3 modes:
1. Hello world
Single queue mode
2. Publish-subscribe
Subscription mode
3. PipeLine model
If we need to count the logs of each machine, we need to distribute the statistical tasks to each node machine , finally collect the statistical results and make a summary


Reference blog:
http://www.linuxde.net/2013/05/13647.html

ZMQ API reference manual: http://api.zeromq.org/
PHP user manual can refer to: http://zguide.zeromq.org/php:all
ZeroMQ learning and research: http://www.searchtb .com/2012/08/zeromq-primer.html
ZMQ PHP Programming Reference Manual: http://php.zero.mq (unreachable)
ZeroMQ, the fastest message queue in history—ZMQ learning and research http: //news.cnblogs.com/n/154000/
There are a large number of program examples for reference: https://github.com/imatix/zguide

The above introduces the zeromq installation---php-zmq, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Introduction to NginxNext article:Introduction to Nginx