So I have had a few people asking me recently about how to manually install a different version of PHP on their Linux server with Plesk, which has prompted me to write this post.
In the past I have not advised this due unforeseen problems that it can have and the amount of work involved, specially if the person managing the server is not familiar with managing a server from the command line.
Now with Plesk 12 there is a simple solution have Plesk do it for you.
One of the many new features in Plesk 12 is the ability to have the panel install more PHP versions that you’re server came with, currently this is only supported with CentOS 6/7 and Ubuntu 14. If you are using Debian then I am afraid that you are out of luck at the moment but you can still change the PHP version you just have to do it the long way, this is also true of Plesk 11.5 if you are using 11.5 then I would recommend an upgrade to version 12, you wont regret it.
My preferred OS is CentOS which the below guide is based on if you are using Debian then I will not be coving this and you should seek the help from Odin see link at bottom of post.
Installing more than one PHP version
There are 2 ways to do this, at install or after install both methods are very simple.
If you are installing a new server then this is simple, when you run the install script select custom, this will enable you to select what you want to install during the install process you will then be able to select the components you what to have installed including multiple PHP versions.
If your server has already been installed then you simply login go and install the required versions from the Plesk panel 1st make sure you have applied all available updates then goto Tools & Settings and select Updates and Upgrades this will then load up the updates pages where you can then select Add/Remove Components then under Web hosting features and Different PHP interpreter versions you can then select the version of PHP you want to install, once selected continue to install the new components, when I did this on my server it was completed within 10 minutes.
Setting PHP Version
After you have installed the required PHP versions you now need to enable them on the sites you want to use them with, again this is a simple task you can update your service plan if you are using them or you can update the hosting setting by going to the subscription Websites & Domains and selecting Hosting Settings, from the hosting settings page you can then set the PHP version, you will need to make sure that the PHP handler type is set to FastCGI.
If you have done the above then you can now check your sites PHP version with a phpinfo page this should now show that your PHP version is the version you have set in the hosting settings.
You can read more on the using different PHP version from the Odin Knowledge base http://kb.odin.com/en/118378