Home >Backend Development >PHP Tutorial >Apache and PHP installation, php compilation and installation of php-amq extension concise tutorial

Apache and PHP installation, php compilation and installation of php-amq extension concise tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-28 08:28:55877browse

This article describes how to compile and install php-amq extension in php. Share it with everyone for your reference, the details are as follows:

Purpose: This extension is used to operate the rabbitmq server

1. Installation overview

1. Compile and install the librabbitmq library

This is an open source c language library. Used to communicate with rabbitmq

The php-amqp extension of php uses this library to communicate with the server. So you must install this open source library first.

Download address: https://github.com/alanxz/rabbitmq-c/

Click here to download from this site.

2. Compile the source code of php-amqp extension

Note: The two versions must be specified to avoid conflicts. The librabbitmq library is version 0.5.2. php-amq is version 1.4.0

This extension is maintained by php official, go to php official download: http://pecl.php.net/package/amqp

Second, compilation steps

Step 1: First Installation library: librabbitmq

Version requirements: Version 0.5.2 is 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=Specify which directory the library is installed to, and install php in the second step- This library needs to be introduced when amqp is used. Recommended directory: /usr/local/librabbitmq/0.5.2/

5, make && make install

Step 2: Compile the php-amqp module

Version requirements: 1.4.0 is required.

Download location: http://pecl.php.net/package/amqp

Compilation sequence

1. Unzip the amqp-1.4.0 source code compression package

2. cd amqp-1.4.0

3. phpize #phpize path is determined according to the location of server phpize

4,

./configure --with-php-c/php-5.5.18/bin/php-config  --with-amqp  --with-librabbitmq-dir=这里填写第一步librabbitmq库的安装位置

5,

make && make install

The third step, restart php-fpm to make the new module take effect

The restart command of php-fpm is general It is: PHP installation directory/sbin/init.d.php-fpm restart

Readers who are interested in more PHP-related content can check out the special topics of this site: "Introduction Tutorial on PHP Object-Oriented Programming", "Summary of PHP Mathematical Operation Skills" ", "Summary of PHP operating office document skills (including word, excel, access, ppt)", "Complete PHP array (Array) operation skills", "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 be helpful to everyone in PHP programming.

The above has introduced a concise tutorial on Apache and PHP installation, php compilation and installation of php-amq extension, including Apache and PHP installation. 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