# 安装rabbitmq-c依赖包
yum install libtool autoconf

# 安装rabbitmq-c ( 最好下载 0.5的,0.6安装可能会报错)
# 版本下载:https://github.com/alanxz/rabbitmq-c/releases/tag/v0.9.0
wget https://github.com/alanxz/rabbitmq-c/archive/v0.9.0.tar.gz
tar -zxvf v0.9.0.tar.gz
cd rabbitmq-c-0.9.0/
autoreconf -i
./configure –prefix=/usr/local/rabbitmq-c
make
make install

# 安装PHP扩展 amqp
wget http://pecl.php.net/get/amqp-1.9.4.tgz
tar zxvf amqp-1.9.4.tgz
cd amqp-1.9.4
/usr/local/php7.3/bin/phpize
./configure –with-php-config=/usr/local/php7.3/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-fpm7.3 restart

Comments are closed.

Post Navigation