Home>Article>Backend Development> Detailed explanation on how to install php5.2 on CentOS6.x/6.5/6.4/6.3/6.2/7.x 64-bit
By default, CentOS6 64 bit no longer supports php5.2.x, but some PHP programs still need zend optimizer support. What should I do? Currently, most yum repos no longer support direct installation of php5.2. How to install php5.2 on CentOS6.x/6.5/6.4/6.3/6.2/7.x 64-bit (automatic installation using YUM)
wget -qq -O - http://www.atomicorp.com/installers/atomic | /bin/bash
Backup[ !!! Take php.ini , php.conf and other backups !!! ]
, if it is a new installation, ignore this part.
Delete the installed php packageyum remove php*
Installyum install atomic-php52*
Make mapping :
ln -s /opt/atomic/atomic-php52/root/usr/bin/php /usr/bin/php ln -s /opt/atomic/atomic-php52/root/usr/bin/php-cgi /usr/bin/php-cgi ln -s /opt/atomic/atomic-php52/root/etc/php.d/ /etc/php.d ln -s /opt/atomic/atomic-php52/root/etc/php.ini /etc/php.ini ln -s /opt/atomic/atomic-php52/root/usr/lib64/php/ /usr/lib64/php ln -s /opt/atomic/atomic-php52/root/usr/share/php/ /usr/share/php vi /etc/httpd/conf.d/atomic-php52-php.conf # Edit prefork part from libphp5.so to libphp52.so: LoadModule php5_module modules/libphp52.so
Test:
# php -v PHP 5.2.17 (cli) (built: May 21 2014 09:58:58) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies # uname -a Linux host819.ctohome.com 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux [root@host819 etc]# cat /etc/redhat-release CentOS release 6.5 (Final)
Done! !
Finding:
service httpd restart vi /etc/yum.conf
Add exclude=php* to prevent accidentally upgrading php
Just install zend optimizer:
This program makes use of the Zend Scripting Language Engine: Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
If you need us to help you install php5.2 Zend Optimizer, the cost is 100 yuan/server/installation
centos5. x 32bit default installation is php5.1.x version. To upgrade to php5.2, you can try the following method:
cd /tmp; rpm -ivh http://software.virtualmin.com/bleed/centos/5/i386/virtualmin-bleed-release-1.0-1.rhel.noarch.rpm rm -f php*
vi /etc/yum.conf Add the following line to prohibit upgrading to php5.3
exclude=php*5.3*
Execute the following command to start upgrading php, check whether the version of php5.2 is displayed
yum update php*
vi /etc/yum.conf Add the following line to prohibit upgrading php
exclude=php*5.3* php*
centos5.x 32bit Another method to install php5.2:
rpm -Uvh http://mirror.webtatic.com/yum/centos/5/latest.rpm rm -f php*
vi /etc/yum.conf Add the following line to disable the upgrade of php5.3
exclude=php*5.3*
Execute the following command to start upgrading php , check whether the version of php5.2 is displayed
yum --enablerepo=webtatic --exclude=php*5.3* update php*
Install the missing php library:
yum --enablerepo=webtatic --exclude=php*5.3* install mcrypt mbstring php -mbstring php-mcrypt
After the upgrade is successful,
vi /etc/yum.conf add the following line to prohibit upgrading php
exclude=php*5.3* php*
More related php knowledge, Please visitphp tutorial!
The above is the detailed content of Detailed explanation on how to install php5.2 on CentOS6.x/6.5/6.4/6.3/6.2/7.x 64-bit. For more information, please follow other related articles on the PHP Chinese website!