- Hits: 769
- 2 Comments
- Subscribe to updates
- Bookmark
Updating from PHP 5.1/5.2 to PHP 5.3 on CentOS Servers
Joomla! 1.6 requires PHP 5.3 or later to be installed. When requesting a new server, this is far less of a problem as many will be provisioned with PHP 5.3 already installed. What should you do, however, if you are running a version of CentOS prior to 5.6 you will need to manually update PHP before Joomla 1.6 will install.
In fact, even with Joomla 1.5 you may experience issues if you are running an earlier version of PHP. The latest build of Akeeba Backup, for example, requires PHP 5.3.
This post will detail the method you need to use to update from PHP 5.1 or 5.2 to PHP 5.3 (Note: These instructions should not be followed to update from PHP4 unless you know exactly what you are doing!)
The default Yum repositories currently contain PHP 5.1.3 which is, of course, too old for our needs. So we are going to need to add another repository.
Atomicorp, the makers of Atomic Secured Linux host a repository containing the information we need. They have instructions on how to install the repository here, but we are going to pursue a slightly more secure method (Note: It is never wise to pipe the output of wget straight to the shell!).
To begin, you will need Shell access to your server. The most common method of obtaining this is to use Secure Shell (SSH), however some control panels such as Plesk will allow you to obtain this access from within your browser.
cd /tmp
wget -q -O installer.sh "http://www.atomicorp.com/installers/atomic"
cat installer.sh
The last command will allow you to view the contents of the downloaded file, have a quick look over just to see if there's anything suspicious! At time of writing, running the md5sum command should give the following result (this will change if they update the script)
md5sum installer.sh
da96f1f49fb431ce99ef3bc9db0cfcec installer.sh
Now having verified the script, we can execute it and perform the upgrade
source installer.sh
yum upgrade # Follow the instructions
service httpd restart # Restart the HTTP Daemon (usually Apache)
If all went well you should now be running PHP 5.3! The process will take a while as there may be quite a number of packages that need updating once the new repository has been installed. Future updates should be far less painful however, simply requiring
yum upgrade packagename #e.g. yum upgrade php
Virya Technologies can provide support if you encounter problems or simply feel that you'd like someone else to perform the upgrade for you
Comments
Hi,
If you run
yum install yum-allowdowngrade
Then enable displaying of duplicate packages
nano /etc/yum.conf
Add showdupesfromrepos=1
exit and save
yum list php
Find the relevant package
yum --allow-downgrade install packagename
i.e.
yum --allow-downgrade install php-5.1.6
It'd be better to see if newer versions of Asterisk is compatible though!

Hi, I followed these steps and worked great and upgraded my php 5.1.6 to 5.3.10. Now unfortunately I had asterisk installed on that server too and found out that asterisk version I am running is not compatible with new version of php. Is there a way to undo this upgrade? Is there a procedure out there to do that?