Home > Article > Operation and Maintenance > centos php5.6 installation tutorial
# Recommended: "Centos php5.6 installation method: first delete the old php; then add the third-party yum source and install the required php version; finally restart the apache service through the command "service httpd restart".
centos tutorial 》
yum list installed | grep php #可以查看所有已安装的php软件yum remove php* #删除所有php软件
yum list php* #查看是否有你需要的php版本,没有的话就需要下面的添加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.rpmThen install the required php version: such as
php56w
yum install php56w #安装php5.6
php -v #安装完成后查看当前版本#会显示下面的内容PHP 5.6.26 (cli) (built: Sep 17 2016 13:45:08) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies#安装成功
service httpd restart #如果不重启,在页面中运行phpinfo()你会发现还是原来的版本
The above is the detailed content of centos php5.6 installation tutorial. For more information, please follow other related articles on the PHP Chinese website!