PHP's RABBITMQ extension Module AMQP installation

Source: Internet
Author: User
Tags rabbitmq


To use the PHP development, to use the intermediate queue RABBITMQ, you must install the PHP extension Module AMQP, the server environment is php7.1.18, CentOS 6.8, Nginx 1.8

Using PHP's pecl command:/usr/local/php/bin/pecl install AMQP installation AMQP has reported the following error:

 checking for AMQP using pkg-config ... CONFIGURE:ERROR:LIBRABBITMQ not found

  error: '/tmp/pear/temp/amqp/configure--with-librabbitmq-dir ' failed

The wrong reason for reading the newspaper is that the LIBRABBITMQ library file is missing and the entire resolution is as follows:

 


The first step is to install LIBRABBITMQ



There are two ways to install LIBRABBITMQ, as follows:



The first method: directly using Yum to install LIBRABBITMQ, this method may not work, is your yum environment configuration problem, search is not LIBRABBITMQ, can not install, that will go to the following second method.



Second method: Install rabbitmq-c-0.7.1


                     Download Address: wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.7.1/rabbitmq-c-0.7.1.tar.gz

                       TAR-XZVF   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 the installation is complete, you can continue to install AMQP



Second Step installation AMQP



Run command:/usr/local/php/bin/pecl install AMQP Run this command will appear as follows.



Set the path to librabbitmq install prefix [AutoDetect]:



If you are using the first method yum directly installed LIBRABBITMQ, you can directly press ENTER, if the second method, you need to install rabbitmq-c-0.7.1 directory input into the/usr/local/rabbitmq-c-0.7.1 and then press ENTER.



The third step is to add the extension module



After the AMQP installation is complete, you will be prompted to add the amqp.so extension module to the PHP configuration file.



Restart PHP-FPM



part Fourth Check AMQP module installation



Use the command phpinfo to view, appear as follows, indicating the installation was successful



AMQP protocol version 0-9-1
LIBRABBITMQ version 0.5.2


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.