When using RABBITMQ Message Queuing in PHP development, you need to install the PHP extension AMQP, which is the following installation steps:
Install the AMQP extension directly using the PECL
/usr/local/php/bin/pecl Install AMQP
If the LIBRABBITMQ library file is missing, you need to install LIBRABBITMQ first, the following steps:
1 wget https://GITHUB.COM/ALANXZ/RABBITMQ-C/RELEASES/DOWNLOAD/V0.7.1/ rabbitmq-c-0.7.1.tar.gz2 tar-zxvf Rabbitmq-c-0.7.1.tar. GZ 3 CD rabbitmq-c-0.7.14 ./configure--prefix=/usr/local/rabbitmq-C5 Make & & Make Install
LIBRABBITMQ after the installation is complete, continue execution
/usr/local/php/bin/pecl Install AMQP
You will need to enter the installation directory/usr/local/rabbitmq-c where LIBRABBITMQ is installed, and get the amqp.so extension path at this time/usr/local/php/lib/php/extensions/ No-debug-non-zts-20160303/amqp.so, join the php.ini configuration file,
[Amqp]extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/amqp.so
Restart PHP-FPM:
PHP-FPM restart
Execution at this time
php-m | grep AMQP
You can see the AMQP extension, which means that the AMQP extension is successfully installed and now you can use RABBITMQ in PHP!
php7.1 Installing the AMQP extension