php怎么安装rabbitmq扩展插图

本文操作环境:centos 7、php7、thinkpad t480电脑。

PHP安装rabbitmq扩展的步骤如下所示:

安装有关依赖

yum -y install gcc glibc-devel make ncurses-devel openssl-devel autoconf unixODBC unixODBC-devel socat

安装erlang运行环境

wget https://www.rabbitmq.com/releases/erlang/erlang-19.0-1.el6.x86_64.rpm
yum -y install erlang-19.0-1.el6.x86_64.rpm

输入erl测试是否成功 输入halt().退出

安装amqp-c

wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.8.0/rabbitmq-c-0.8.0.tar.gz
 
tar -zxvf rabbitmq-c-0.8.0.tar.gz
 
cd rabbitmq-c-0.8.0
 
./configure --prefix=/usr/local/rabbitmq-c
 
make && make install

安装amqp扩展

yum install epel-release
 
yum install autoconf gcc gcc-c++ librabbitmq librabbitmq-devel
 
wget https://pecl.php.net/get/amqp-1.9.4.tgz
 
tar xf amqp-1.9.4.tgz
 
cd amqp-1.9.4
 
phpize
 
./configure --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c
 
make && make install

安装界面管理组件

rabbitmq-plugins enable rabbitmq_management

启动服务

service rabbitmq-server start

创建管理员用户

rabbitmqctl add_user admin amqp123
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
rabbitmqctl set_user_tags admin administrator

开放15672端口

firewall-cmd --zone=public --add-port=15672/tcp --permanent
firewall-cmd --reload

登录管理后台

使用账号 admin amqp123 登录

http://IP地址:15672

推荐学习:php培训

以上就是php怎么安装rabbitmq扩展的详细内容,更多请关注亿码酷站其它相关文章!


<!–亿码酷站直播班–>php怎么安装rabbitmq扩展
—–文章转载自PHP中文网如有侵权请联系ymkuzhan@126.com删除

云服务器推荐