Because you want to use the message queue, you need to install the ampq extension locally. As a result, during the installation process, the following error is reported:
configure: error: Please reinstall the librabbitmq distribution itself or (re)install librabbitmq development package if it available in your system
I searched all over the Internet and found the following article that perfectly solved my problem. I am reprinting it here for future reference.
The reason for this error is because the amqp dependency package rabbitmq-c is not installed, and rabbitmq-c needs to be installed first.
If not installed, the above error will be prompted
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.gz tar zxf rabbitmq-c-0.7.1.tar.gz cd rabbitmq-c-0.7.1 ./configure --prefix=/usr/local/rabbitmq-c-0.7.1 make && make install
After success, you will see the following interface
I chose 1.6 .1
wget https://pecl.php.net/get/amqp-1.6.1.tgz tar zxf amqp-1.6.1.tgz cd 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
here is required The same address as the rabbitmq-c
installation above
make && make install
After the installation is successful, record the following address, configure and add php Useful when using modules
vi /usr/local/php/etc/php.ini
Finally add a line
extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/amqp.so
Restart php
service php-fpm restart
Use phpinfo to check whether amqp is installed successfully
The above is the detailed content of When PHP installs the amqp extension, an error occurs that librabbitmq is not installed.. For more information, please follow other related articles on the PHP Chinese website!