1. 卓越技术网首页
  2. 运维技术
  3. Linux

Centos下Yum安装PHP5.5、PHP5.6、PHP7.0

Centos系统默认有php,但是默认的版本太低,手动安装有一些麻烦,于是使用Yum来安装。

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源

Centos 5.x

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

CentOs 6.x

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

CentOs 7.x

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

3.安装PHP

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
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
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

yum install php55w-fpm
yum install php56w-fpm
yum install php70w-fpm

原创文章,作者:moon,如若转载,请注明出处:https://www.zyfun.cn/yunwei/155.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注