时间:2021-07-01 10:21:17 帮助过:80人阅读
1.首先,删除centos上面的PHP
# yum remove php-common
2.引入yum源
CentOS 6.x 源
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm # rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
CentOS 7.x 源
# 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
3.根据自己的centos版本进行选择安装,执行后进行安装PHP
# yum install php70w-common php70w-mbstring php70w-fpm php70w-pecl-memcached php70w-opcache php70w-mysqlnd php70w-pecl-redis php70w-devel
4.在这里只是安装了一些PHP常用扩展,加新扩展
# yum install php70w-gd
5.查看PHP版本
# php -v
相关推荐:
centos安装php5、卸载php、安装php7
CentOS安装PHP5.6实例
以上就是CentOS安装PHP版本切换的详细内容,更多请关注Gxl网其它相关文章!