欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

安装rabbitMQ的PHP扩展

程序员文章站 2022-10-28 09:14:26
1.环境准备:centos 7.6+PHP7.3 2.安装rabbitmq-ctar xf rabbitmq-c-0.9.0.tar.gzcd rabbitmq-c-0.9.0mkdir build && cd buildcmake -DCMAKE_INSTALL_PREFIX=/usr/local ......

1.环境准备:centos 7.6+php7.3

2.安装rabbitmq-c
tar xf rabbitmq-c-0.9.0.tar.gz
cd rabbitmq-c-0.9.0
mkdir build && cd build
cmake -dcmake_install_prefix=/usr/local/rabbitmq-c ..
cmake --build . --target install
cd /usr/local/rabbitmq-c/
ln -s lib64 lib

3.安装amqp扩展
tar xf amqp-1.9.4.tgz
cd amqp-1.9.4
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c
make && make install
vi /usr/local/php/lib/php.ini
extension = amqp.so

4.重启php-fpm
systemctl restart php-fpm

5.检查确认
php -i |grep amqp
php -m

参考:https://blog.csdn.net/c571121319/article/details/84496205