PHP official website of the AMQP module introduced here, I do not introduce more. Below to enter the focus of the installation process.
http://www.php.net/manual/en/book.amqp.php
The default source for Ubuntu is not PHP5-AMQP this package, so use the AMQP Test manual compilation.
Preparatory work:
# Install PHP compiler tool
sudo apt-get install Php5-dev
# Install the RABBITMQ library
sudo apt-get install Librabbitmq-dev
Then, if you don't have git installed, install git, because we're going to get the source code from the official version library.
#克隆并准备好代码
git clone git://github.com/alanxz/rabbitmq-c.git
CD rabbitmq-c
git submodule update
# Compile Extensions
Autoreconf-i &&/configure && make && sudo make install
Then we need to download the PHP extension source code, address here:
Http://pecl.php.net/package/amqp
Current Latest version is 1.0.7
wget http://pecl.php.net/get/amqp-1.0.7.tgz
Tar zxf amqp-1.0.7.tgz
CD amqp-1.0.7/
Phpize &&/configure--with-amqp && make && sudo make install
# Create a configuration file
sudo echo "extension = amqp.so" >/etc/php5/conf.d/amqp.ini
Then reboot your Web server or PHP-FPM and print the phpinfo, and if you see the following, expand the installation.