安装php的rabbitmq扩展amqp

第一步:
# 下载 rabbitmq-c library
mkdir rabbitmq-c
cd rabbitmq-c
wget https://github.com/alanxz/rabbitmq-c/tarball/0.2
tar zxvf 0.2
# 删除压缩包
rm -rf 0.2
cd alanxz-rabbitmq-c-f8f4fc7

# 下载最新版的codegen配件
wget https://github.com/rabbitmq/rabbitmq-codegen/tarball/master
tar zxvf master
mv rabbitmq-rabbitmq-codegen-7597914 codegen
# 删除压缩包
rm -rf master

# 配置、编译、安装
autoreconf -i
./configure
make
sudo make install

第二步:
安装php的amqp扩展:
wget http://pecl.php.net/get/amqp-1.0.7.tgz
tar -zxvf amqp-1.0.7.tgz
cd amqp-1.0.7
/usr/local/starcast/php/bin/php
./configure --with-php-config=/usr/local/starcast/php/bin/php-config --with-amqp
make
sudo make install
#直接在php.ini中添加生成的amqp.so
vim  /usr/local/starcast/php/lib/php.ini
# 加入一行 extension = amqp.so
#重启httpd或php-cgi即可

原文地址:https://www.cnblogs.com/mingaixin/p/2743807.html