安装rabbitmq-c-0.8.0
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.8.0/rabbitmq-c-0.8.0.tar.gz
tar -zxvf rabbitmq-c-0.8.0.tar.gz
cd rabbitmq-c-0.8.0
./configure --prefix=/usr/local/rabbitmq-c
make
make install
安装amqp
wget https://pecl.php.net/get/amqp-1.9.3.tgz
tar -zxvf amqp-1.9.3.tgz
cd amqp-1.9.3
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c/
make
make install
- 会发现/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/ampq.so
- 在php.ini添加
extension=amqp.so