If you run a cPanel server and need to upgrade APACHE and PHP version, cPanel provides the EasyApache tool.
To upgrade the APACHE and PHP, run the following command as a root via SSH:
This will bring an interactive menu. Unless you completely want to rebuild APACHE and PHP configuration from the ground up, leave the selection on Previously Saved Config, then use the Tab key and the arrow keys until you have selected Start customizing based on the profile. Press Enter to move to the next screen and choose the version of Apache you wish to run on the server.
When you choose the version of PHP to change, make sure to research your site’s code base to see if it works with the new version because Easyapache installs Zend Optimizer for PHP 5.2 and Zend Guard for PHP 5.3.
On the next screen, select Short Options List, to select the most commonly used Apache and PHP modules. If there is a module you wish to install is not on this list, select Exhaustive Options List. Otherwise, click Save and Build to begin the compile process. After this process, it will restart APACHE.
When the Easyapache process has finished, take some time to test your sites and make sure that they still run the new versions of Apache and PHP. If there is any trouble, run a new Easyapache using a saved configuration.