Home > Backend Development > PHP Tutorial > Detailed explanation on how to install php5.2 on CentOS6.x/6.5/6.4/6.3/6.2/7.x 64-bit

Detailed explanation on how to install php5.2 on CentOS6.x/6.5/6.4/6.3/6.2/7.x 64-bit

藏色散人
Release: 2023-04-08 11:02:01
forward
1897 people have browsed it

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*

Install yum 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
Copy after login

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)
Copy after login

Done! !

Finding:

service httpd restart
vi /etc/yum.conf
Copy after login

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
Copy after login

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*
Copy after login

vi /etc/yum.conf Add the following line to prohibit upgrading to php5.3

exclude=php*5.3*
Copy after login
Copy after login

Execute the following command to start upgrading php, check whether the version of php5.2 is displayed

yum update php*
Copy after login

vi /etc/yum.conf Add the following line to prohibit upgrading php

exclude=php*5.3* php*
Copy after login
Copy after login

centos5.x 32bit Another method to install php5.2:

rpm -Uvh http://mirror.webtatic.com/yum/centos/5/latest.rpm
rm -f php*
Copy after login

vi /etc/yum.conf Add the following line to disable the upgrade of php5.3

exclude=php*5.3*
Copy after login
Copy after login

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*
Copy after login

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*
Copy after login
Copy after login

More related php knowledge, Please visit php 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!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template