This article describes how PHP compiles and installs PHP-AMQ extensions. Share to everyone for your reference, as follows:
Purpose: This extension is used to operate the RABBITMQ server
First, the installation of the overall
1. Compile and install LIBRABBITMQ Library
This is an open source C language library. Used to communicate with the RABBITMQ
The PHP-AMQP extension of PHP is to use this library to communicate with the server. So you have to install this open source Library first.
Download Address: https://github.com/alanxz/rabbitmq-c/
Click here to download this site.
2, compiled PHP-AMQP extension of the source code
Note: Two versions to specify, avoid conflicts. The LIBRABBITMQ library is version 0.5.2. PHP-AMQ is 1.4.0 version
This extension is PHP official in maintenance, go to PHP official download: HTTP://PECL.PHP.NET/PACKAGE/AMQP
Second, compile the steps
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.
CD rabbitmq-c-0.5.2
3.
Autoreconf-i
4./configure--prefix= Specifies which directory the library is installed in, and the second step is to introduce this library when installing PHP-AMQP. Suggested Directory:/USR/LOCAL/LIBRABBITMQ/0.5.2/
5. Make && make install
Step two: Compile the PHP-AMQP module
Version requirements: 1.4.0 required.
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-c/php-5.5.18/bin/php-config --with-amqp --with-librabbitmq-dir= Here is the first step to the installation location of the LIBRABBITMQ library
5.
Make && make install
Step three, restart PHP-FPM to make the new module effective
The PHP-FPM Restart command is typically: PHP installation directory/sbin/init.d.php-fpm restart
More readers interested in PHP related content can view the topic: "PHP Primer for Object-oriented programming", "PHP Math Skills Summary", "PHP operation Office Document Skills Summary (including word,excel,access,ppt)", "PHP Array ( Array), "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 is helpful to you in PHP programming.
The above describes the Apache and PHP install PHP installation php-amq extension Concise tutorial, including the Apache and PHP installation aspects, I hope to be interested in PHP tutorial friends helpful.