安装rabbitmq-c依赖包
yum install libtool autoconf
下载安装rabbitmq-c
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.5.0/rabbitmq-c-0.5.0.tar.gz tar -zxvf rabbitmq-c-0.5.0.tar.gz cd rabbitmq-c-0.5.0/ autoreconf -i ./configure --prefix=/usr/local/rabbitmq-c make make install
安装PHP扩展 amqp
wget http://pecl.php.net/get/amqp-1.9.1.tgz //百度云地址链接:https://pan.baidu.com/s/1ZDUqY5r-Hg29t63QiDM1ew 密码:ipwx tar -zxvf amqp-1.9.1 cd amqp-1.9.1 /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 //打开配置文件 extension=amqp.so //添加扩展名
重启php-fpm
/etc/init.d/php-fpm restart
成功~
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/2352.html