1.安装rabbitmq-c
下载地址:https://github.com/alanxz/rabbitmq-c/releases
wget -c https://github.com/alanxz/rabbitmq-c/releases/download/v0.8.0/rabbitmq-c-0.8.0.tar.gz tar zxf rabbitmq-c-0.8.0.tar.gz cd rabbitmq-c-0.8.0 ./configure --prefix=/www/server/php/74/rabbitmq-c-0.8.0 make && make install
2安装amqp
官网下载地址:http://pecl.php.net/package/amqp
我选择的是1.10.0
https://pecl.php.net/package/amqp/1.10.0 tar zxvf amqp-1.10.0.tgz cd amqp-1.10.0 /www/server/php/74/bin/phpize ./configure --with-php-config=/www/server/php/74/bin/php-config --with-amqp --with-librabbitmq-dir=/www/server/php/74/rabbitmq-c-0.8.0 make && make install
安装成功之后记录下面的地址,配置添加php模块的时候有用
3.添加php模块
extension = /www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902/amqp.so
4.重启php
service php-fpm restart
phpinfo来检查一下amqp是否安装成功



