1.下载https://github.com/alanxz/rabbitmq-c/releases/tag/v0.11.0
wget https://github.com/alanxz/rabbitmq-c/archive/refs/tags/v0.11.0.tar.gz
tar -zxvf v0.11.0.tar.gz && cd rabbitmq-c-0.11.0
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/rabbitmq-c ..
cmake --build . --target install
cd /usr/local/rabbitmq-c
ln -s lib64 lib
2.下载http://pecl.php.net/package/amqp
wget http://pecl.php.net/get/amqp-1.10.2.tgz
tar -zxvf amqp-1.10.2.tgz && cd amqp-1.10.2
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c
make && make install
编辑php.ini文件,增加amqp扩展支持
vim /usr/local/php/etc/php.ini
增加下面内容; rabbitmq扩展支持extension=amqp.so
重启php-fpm
/etc/init.d/php-fpm restart
网友评论