For more information about how to manually compile php-amqp extensions in ubuntu in linux, see.
The amqp module on the PHP official website is described here. The following describes the key installation steps.
Http://www.php.net/manual/en/book.amqp.php
For ubuntu default source there is no php5-amqp this package, so use the amqp to test the manual compilation.
Preparations:
# Install the php compilation tool
Sudo apt-get install php5-dev
# Install the library of rabbitmq
Sudo apt-get install librabbitmq-dev
If you have not installed git, install git because we need to obtain the source code from the official version library.
# Clone and prepare the code
Git clone git: // github.com/alanxz/rabbitmq-c.git
Cd rabbitmq-c
Git submodule update
# Compilation Extension
Autoreconf-I &./configure & make & sudo make install
Then we need to download the php extension source code:
Http://pecl.php.net/package/amqp
The 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
Restart your web server or php-fpm and print phpinfo. If you see the following content, the extension is installed.