安裝rabbitmq-c依賴包
yum install libtool autoconf
下載安裝rabbitmq-c
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.5.0/rabbitmq-c-0.5.0.tar.gz tar -zxvf rabbitmq-c-0.5.0.tar.gz cd rabbitmq-c-0.5.0/ autoreconf -i ./configure --prefix=/usr/local/rabbitmq-c make make install
安裝PHP擴充套件 amqp
wget http://pecl.php.net/get/amqp-1.9.1.tgz //百度雲地址連結:https://pan.baidu.com/s/1ZDUqY5r-Hg29t63QiDM1ew 密碼:ipwx tar -zxvf amqp-1.9.1 cd amqp-1.9.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 make make install
編輯php.ini檔案,增加amqp擴充套件支援
vim /usr/local/php/etc/php.ini //開啟配置檔案 extension=amqp.so //新增副檔名
重啟php-fpm
/etc/init.d/php-fpm restart
成功~