centos下 安装PHP的amqp扩展

先安装rabbitmq-c

cd /download
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.8.0/rabbitmq-c-0.8.0.tar.gz
tar -zxvf rabbitmq-c-0.8.0.tar.gz
cd rabbitmq-c-0.8.0
./configure --prefix=/usr/local/rabbitmq-c
make && make install

现在开始安装amqp扩展

#回到download目录
cd /download
wget https://pecl.php.net/get/amqp-1.9.3.tgz
tar -zxf amqp-1.9.3.tgz
cd amqp-1.9.3
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c
make && make install

image.png

最后在php.ini加上,重启php-fpm即可

extension=amqp.so
image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容