rabbitmq安装php扩展

安装rabbitmq-c依赖包

yum install libtool autoconf

版本下载:https://github.com/alanxz/rabbitmq-c/releases/tag/v0.5.0

wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.5.0/rabbitmq-c-0.5.0.tar.gz
tar -zxvf v0.5.0
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.6.1.tgz
tar zxvf 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
make
make install

编辑php.ini文件,增加amqp扩展支持

vim /usr/local/php/etc/php.ini

增加下面内容

; rabbitmq扩展支持
extension=amqp.so

重启php-fpm

/etc/init.d/php-fpm restart

你可能感兴趣的:(rabbitmq安装php扩展)