Contents
  1. 1. CentOS 升级PHP
    1. 1.1. 卸载、删除旧依赖
    2. 1.2. 更新安装源
    3. 1.3. 安装制定版本PHP
    4. 1.4. 安装FPM

CentOS 升级PHP

卸载、删除旧依赖

  1. 查看系统版本,方便后边选择对应的包
`lsb_release -a`
  1. 停止服务
`service httpd stop`
  1. 卸载安装包
`看图⬇`
![img](http://oluzh4sa6.bkt.clouddn.com/GitHubPages/article/uninstall-old-php.png)
删除依赖
![img](http://oluzh4sa6.bkt.clouddn.com/GitHubPages/article/rpm-dependencies.png)
删除一些其它相关包
![img](http://oluzh4sa6.bkt.clouddn.com/GitHubPages/article/delete-others.png)

更新安装源

1
2
3
4
5
6
7
8
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

安装制定版本PHP

1
2
3
4
5
6
##5.5版本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
##5.6版本PHP
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
##7.0版本PHP
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

安装FPM

1
2
3
4
## 选择对应版本即可
yum install php55w-fpm 
yum install php56w-fpm 
yum install php70w-fpm

    
        
        版权声明:
        本文由Lomo创作和发表,采用署名(BY)-非商业性使用(NC)-相同方式共享(SA)国际许可协议进行许可,
        转载请注明作者及出处,本文作者为Lomo,本文标题为centos upgrade php.
    
    


 Leave a message ^_^:

Contents
  1. 1. CentOS 升级PHP
    1. 1.1. 卸载、删除旧依赖
    2. 1.2. 更新安装源
    3. 1.3. 安装制定版本PHP
    4. 1.4. 安装FPM