linux下安装rabbitmq扩展
1,安装扩展依赖库
rabbitmq-c依赖库下载:
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.7.1/rabbitmq-c-0.7.1.tar.gz
tar zxvf rabbitmq-c-0.7.1.tar.gz
cd rabbitmq-c-0.7.1
./configure --prefix=/usr/local/rabbitmq-c-0.4.1
make && make install
2,安装amqp
wget https://pecl.php.net/get/amqp-1.9.4.tgz
tar -zxvf amqp-1.9.4
cd amqp-1.9.4
phpize (如果没有phpize 安装 yum install php-devel)
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c-0.7.1/
make && make install
更改php配置 vim /etc/php.ini
extension = amqp.so
重启服务 lnmp restart