Centos中怎么Yum安装php5.5、php5.6、php7.0多个版本?

2022-11-14 0 55

Centos中怎么Yum安装php5.5、php5.6、php7.0多个版本?

 

1.检查当前安装的PHP包

 

yum list installed | grep php

 

如果有安装的PHP包,先删除他们

 

yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64

 

2、设置yum源

 

Webtatic EL7 for CentOS/RHEL 7:

 

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

 

Webtatic EL6 for CentOS/RHEL 6:

 

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

 

Webtatic EL5.1 for CentOS/RHEL 5:

 

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm

rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm

 

如果想删除上面安装的包,重新安装

rpm -qa | grep webstatic

rpm -e 上面搜索到的包即可

 

3.运行yum install安装支持包

 

php5.5的版本

 

yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64

 

php5.6的版本

 

yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64

 

php7.0的版本

 

yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64

 

4.安装PHP FPM

 

php5.5的版本:yum install php55w-fpm php55w-opcache

php5.6的版本:yum install php56w-fpm

php7.0的版本:yum install php70w-fpm

 

Zend Opcache 已经集成在了PHP 5.5里面,编译安装PHP5.5的时候加上–enable-opcache就行了。

1. 本站所有资源来源于用户上传和网络,因此不包含技术服务请大家谅解!如有侵权请邮件联系客服!cheeksyu@vip.qq.com
2. 本站不保证所提供下载的资源的准确性、安全性和完整性,资源仅供下载学习之用!如有链接无法下载、失效或广告,请联系客服处理!
3. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!如用于商业或者非法用途,与本站无关,一切后果请用户自负!
4. 如果您也有好的资源或教程,您可以投稿发布,成功分享后有积分奖励和额外收入!
5.严禁将资源用于任何违法犯罪行为,不得违反国家法律,否则责任自负,一切法律责任与本站无关

发表评论
暂无评论