下载,解压rabbitmq-c源码
-
wget -c https://github.com/alanxz/rabbitmq-c/archive/v0.9.0.tar.gz
-
配置,编译,安装
-
-
-
-
-
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/rabbitmq-c ..
-
-
cmake --build . --target install
库软链
ln -s /usr/local/rabbitmq-c/lib64 /usr/local/rabbitmq-c/lib
下载,解压amqp
-
wget -c https://pecl.php.net/get/amqp-1.9.4.tgz
-
-
生成confingure文件
/usr/local/php72/bin/phpize
配置检查,编译,安装
-
./configure --with-php-config=/usr/local/php72/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c
-
-
安装完成
Installing shared extensions: /usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/
查看扩展文件
-
-
amqp.so memcached.so mongodb.so pdo_pgsql.so pgsql.so redis.so
将扩展加入php.ini
echo "extension=amqp.so" >> /usr/local/php72/etc/php.ini
重启php,查看phpinfo();
原文地址:https://www.jmsite.cn/blog-296.html
php的rabbitmq扩展(未测试)