I know that the windows version of Plesk allows you to select a version of PHP (4 or 5) for each domain you host, but can something be done for the Linux varient?

I've got a Plesk 9.5.3 Centos 5.2 dedicated server with root access. A couple of sites I'll be working on developing would require some PHP 5.3 functionality.

Is there a way, either by manipulating vhost.conf for each domain or by installing a module for Plesk, that I could have the facility to install and configure a different version of PHP to run for each domain on the box?

Ideally, it would default to PHP 5.2, with the option for 5.3 and eventually 6.x

My server is a bog standard Plesk installation - I've done nothing apart from install some extra PHP modules using YUM. Atomic has been used to update PHP to version 5.2.17 today.


You could achieve this by installing php as a cgi script (which is basically what windows does), but then you would add a big overhead on cpu time and will make all your scripts quite slow (also consider the security implications).

In my personal taste it is better to keep your php up to date and make everyone comply with the php requirements, and if one of your customers needs an older php version just provide a cgi one warning on the slowness that'll result.

  • Thanks for the reply. I'm pretty confident about updating to 5.3 for everyone, but I'm a bit in the dark about how I could accomplish an older version running through CGI with Plesk? Jan 21 '11 at 7:33
  • You just need to compile the old php version as a cgi script, copy the script into a common cgi-bin folder for all your users (achievable through ScriptAlias, then add the following line to the users virtual host Action application/x-httpd-php5 /cgipath/php-cgi. You can check a complete guide here bobulous.org.uk/coding/apache-php-cgi.html
    – lynxman
    Jan 21 '11 at 8:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.