博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Linux中怎么升级PHP

Posted on 2019-11-25 22:40  淼哥学习园地  阅读(3345)  评论(0编辑  收藏  举报

推荐yum源安装:

#查看 删除老php版本的源
yum list installed | grep 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 

#添加CentOS 7.0的源
yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

#追加CentOS 6.5的epel及remi源
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

#查看php56的源资源
yum list --enablerepo=remi --enablerepo=remi-php56 | grep php

#安装
yum install --enablerepo=remi --enablerepo=remi-php56 php php-fpm php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

 

 

重启PHP:

service php-fpm restart