安装rabbitmq-c
$ yum -y install cmake
$ wget https://github.com/alanxz/rabbitmq-c/archive/refs/tags/v0.9.0.tar.gz
$ cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/rabbitmq-c-0.9.0 #指定安装目录
$ make
$ make install
安装amqp
$ wget https://pecl.php.net/get/amqp-1.9.4.tgz
$ ./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c-0.9.0
$ make
$ make install
在php.ini中添加扩展
extension=amqp.so