The error message "librabbitmq and amqplibrabbitmq" is not installed when amqp extension is installed in PHP.

Source: Internet
Author: User

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.1Follow the above stepsrabbitmq-cThe 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.