This article describes the way PHP compiles and installs PHP-AMQ extensions. Share to everyone for your reference, specific as follows:
Usage: This extension is used to manipulate the RABBITMQ service-side
First, the installation of the umbrella
1. Compile and install LIBRABBITMQ Library
This is a library of open source C language. Used to communicate with RABBITMQ
The PHP-AMQP extension of PHP is to use this library to communicate with the server. So you must first install this open source Library.
Download Address: https://github.com/alanxz/rabbitmq-c/
Click here to download the site.
2, compile PHP-AMQP extension of the source code
Note: Two versions to be specified, avoid conflicts. The LIBRABBITMQ library is version 0.5.2. PHP-AMQ is version 1.4.0
This extension is PHP official in maintenance, go to PHP official download: HTTP://PECL.PHP.NET/PACKAGE/AMQP
Second, the compilation steps
The first step: Install the Library first: LIBRABBITMQ
Version requirements: 0.5.2 version required.
Compilation order
1,
TAR-XZVF rabbitmq-c-0.5.2.tar.gz
2,
3,
4./configure--prefix= Specifies the directory to which the library is installed, and the second step to install PHP-AMQP is to introduce this library. Suggested Catalog:/USR/LOCAL/LIBRABBITMQ/0.5.2/
5, make && make install
Step two: Compile the PHP-AMQP module
Version requirements: Need to 1.4.0.
Download location: HTTP://PECL.PHP.NET/PACKAGE/AMQP
Compilation order
1, decompression amqp-1.4.0 source compression package
2. CD amqp-1.4.0
3, Phpize #phpize路径根据服务器phpize的位置而定
4,
./configure--with-php-config=/apps/php-5.5.18/bin/php-config --with-amqp --with-librabbitmq-dir= Here is the first step LIBRABBITMQ library installation location
5,
Step three, restart PHP-FPM to make the new module effective
PHP-FPM's restart commands are: PHP installation directory/sbin/init.d.php-fpm restart
More interested in PHP related content readers can view the site topics: "PHP object-oriented Program Design Primer", "PHP Mathematical Arithmetic Skills summary", "PHP Operations Office document tips (including word,excel,access,ppt)", "PHP Array ( Array) Operation Skills Encyclopedia, "PHP Data structure and algorithm tutorial", "PHP Programming Algorithm Summary", "PHP Regular Expression Usage Summary", and "PHP Common database Operation Skills Summary"
I hope this article will help you with the PHP program design.