The error message "librabbitmq and amqplibrabbitmq" is not installed when amqp extension is installed in PHP.
The ampq extension needs to be locally installed to go through the message queue. the following error is reported during the installation process:
configure: error: Please reinstall the librabbitmq distribution itself or (re)install librabbitmq development package if it available in your system
I searched for the network, and the following article perfectly solved my problem. I will repost a backup copy here.
This error occurs because the dependency package rabbitmq-c of amqp is not installed. You need to install rabbitmq-c first.
1. Install rabbitmq-c-0.7.1
The above error will be prompted if no installation is available.
: Https://github.com/alanxz/rabbitmq-c
I chose the latest version 0.7.1.
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.7.1/rabbitmq-c-0.7.1.tar.gztar zxf rabbitmq-c-0.7.1.tar.gz cd rabbitmq-c-0.7.1./configure --prefix=/usr/local/rabbitmq-c-0.7.1make && make install
The following page is displayed after the operation is successful.
2. Install amqp
Https://pecl.php.net/package/amqp
I chose 1.6.1.
wget https://pecl.php.net/get/amqp-1.6.1.tgztar zxf amqp-1.6.1.tgzcd amqp-1.6.1 /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c-0.7.1
Note:/usr/local/rabbitmq-c-0.7.1
Follow the above stepsrabbitmq-c
The installation address is the same.
make && make install
After the installation is successful, record the following address, which is useful when configuring to add the php module.
3. Add the php Module
vi /usr/local/php/etc/php.ini
Last add row
extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/amqp.so
Restart php
service php-fpm restart
4. Check the installation of amqp
Use phpinfo to check whether the installation of amqp is successful.
Reprinted from: https://www.phpsong.com/2223.html