Home >Backend Development >PHP Problem >How to install php5.6 under centos
How to install php5.6 under centos: first check the existing php version in the system; then execute the [yum -y remove] command to delete; then add the yum source; finally execute [yum install -y remi -php56] command to install.
First find the existing version in the system
(Recommended tutorial: php graphic tutorial)
yum list installed | grep php
If there is an existing php version, execute the following command to delete it
yum -y remove php-common
Then take the centos6 system as an example and add the yum source of CentOS 6.x
(Video tutorial recommendation: php video tutorial)
rpm -Uvh http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Finally use the yum command to install PHP, install the 5.6 version as remi-php56, and install the 5.5 version as remi-php55
yum install -y --enablerepo=remi,remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-commo
The above is the detailed content of How to install php5.6 under centos. For more information, please follow other related articles on the PHP Chinese website!