I have a dedicated server that hosts a number of websites currently running PHP 5.2. I need to upgrade the PHP version and I have been told I can do this via SSH using this command:
yum upgrade php
No I’m a little concerned about making an update and a website not being able to function any more, so is there a rollback command I can use so that if something does go wrong I can quickly change back to PHP 5.2?
Many thanks
2
Answers
You’d better know what has changes from php 5.2 to php 5.3 first, if you think the changes won’t affect you scripts, then upgrade, if not, then stay with php 5.2 or make the necessary changes in your scripts first (Personnaly I do recommand you upgrading to PHP 5.3) , here is the list of changes Migrating from PHP 5.2 to 5.3
If you face some problems after making the upgrade, check the package repository if php 5.2 still exists in it (use the command “yum search php”), if it does then remove the current PHP you got (command “yum remove php”) and then install the package you found ( for example : “yum install php-5.2”)
Note : If you don’t find the PHP 5.2 package in the repository, you may have to compile PHP 5.2 from source.
You can backup the old php version yourself but I cannot recommend this. Usually it’s only phpize, php.ini, php.so and the php modules folder. Then you can make the update.