1.安装rabbitmq-c
wget https://github.com/alanxz/rabbitmq-c/archive/refs/tags/v0.11.0.tar.gz
tar -zxvf v0.11.0.tar.gz -C /usr/local/
cd /usr/local/rabbitmq-c-0.11.0/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/rabbitmq-c-0.11.0
cmake --build . --target install
ln -s /usr/local/rabbitmq-c-0.11.0/lib64 /usr/local/rabbitmq-c-0.11.0/lib
2.安装php-amqp
wget https://pecl.php.net/get/amqp-1.11.0.tgz
tar -zxvf amqp-1.11.0.tgz
cd amqp-1.11.0/
/www/server/php/73/bin/phpize
#phpize
./configure --with-php-config=/www/server/php/73/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c-0.11.0
make && make install
3.php.ini启用扩展并重启(本人用的是php7.3版本)
extension=/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/amqp.so
4.phpinfo验证查看
安装成功!!!
每天分享一下,自己研究的小成果!,点赞关注加收藏!