首页 文章 centos6/7/8 利用yum安装多版本php

centos6/7/8 利用yum安装多版本php

发布时间:2020-07-21 11:34:03 作者:Soul-Yang 阅读量:1433

1.安装多版本php(根据系统不同修改版本数字6/7/8):

# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum install php56 
# yum install php72
# yum install php56-php-fpm
# yum install php72-php-fpm

2.确保两个版本均已停止

# systemctl stop php56-php-fpm
# systemctl stop php72-php-fpm

3.配置selinux

要允许selinux运行php-fpms脚本,请运行以下命令:

# semanage port -a -t http_port_t -p tcp 9072
# semanage port -a -t http_port_t -p tcp 9056

4.配置php-fpm

每个php-fpm版本都在9000端口上侦听。因为我们要运行多个php版本,所以我们需要更改默认端口:

# sed -i 's/:9000/:9056/' /etc/opt/remi/php56/php-fpm.d/www.conf
# sed -i 's/:9000/:9072/' /etc/opt/remi/php72/php-fpm.d/www.conf

现在运行两个php-fpms:

# systemctl start php72-php-fpm
# systemctl start php56-php-fpm

5.加入开机启动

# systemctl enable php56-php-fpm
# systemctl enable php72-php-fpm
# systemctl start php56-php-fpm
# systemctl start php72-php-fpm

6. 安装PHP 扩展。

比如,Redis:

# yum install php72-php-redis 

安装 swoole:

# yum install php72-php-swoole






  
留言
https://blog.key9.cn/
用户登录
您还没有写任何评论内容!
您已经评论过了!
只能赞一次哦!
您已经收藏啦!