PHP binding

2018 年 1 月 8 日2520

Table of Contents

Source Code

http://http://www.zjjv.com///mkoppanen/php-zmq

Build and installation

You will first need to install the MQ (2.1.x or higher recommended)

http://http://www.zjjv.com///intro:get-the-software

Then obtain the php bindings for 0MQ - these work with PHP 5.2.x and above.

Building via PEAR

The extension can be built via PECL.





sudo pecl install zmq-beta



You may have to add the extension to your php.ini with this line:





extension=zmq.so



Building from Github





git clone git://github.com/mkoppanen/php-zmq.git



and cd to the directory:





$ cd php-zmq



Next, run phpize to generate configure script and run the configure command:





phpize && ./configure



Tip: If you are using php installed from your distribution's package manager the 'phpize' command is usually in php-dev or php-devel package

Finally install the package by running:





$ make && make install



You may have to run this last commands with sudo.

Finally add the following line to your php.ini:





extension=zmq.so



OR:

If you are using PHP 5.4.x and/or using PHP-FPM, you will need to add a zmq.ini file in /etc/php5/conf.d:

Add the following:





extension=zmq.so



Restart PHP-FPM with





sudo /etc/init.d/php5-fpm restart



Windows

Download the latest snapshot from http://http://www.zjjv.com///zmq

General documentation: http://http://www.zjjv.com///mkoppanen/php-zmq/

Test Suite

The test suite can be run using:





$ make test



Bug Reporting

If you encounter problems please fill a bug report at:

http://http://www.zjjv.com///mkoppanen/php-zmq/issues

or write an e-mail to:

mkoppanen (at) php dot net

Mailing List

Discussions about this language binding take place on the general zeromq-dev list.

0 0