- 先安装rabbitmq-c
wget https://github.com/alanxz/rabbitmq-c/archive/refs/tags/v0.14.0.tar.gz
tar zxvf v0.14.0.tar.gz
cd rabbitmq-c-0.14.0
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/rabbitmq-c-0.14.0
make
make install
-安装 rabbitmq扩展
wget https://pecl.php.net/get/amqp-2.1.2.tgz
tar -zxvf amqp-2.1.2.tgz
cd amqp-2.1.2/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-librabbitmq-dir=/usr/local/rabbitmq-c-0.14.0/
make
make install
最后在php.ini加上
extension=amqp.so