linux: one apache two php versions. possible?

If you would use PHP 4 and 5 it would be easy to manipulate what module you want to use with:

<IfModule mod_php5.c> 
<IfModule mod_php4.c> 

So there 3 ways to deal with this problem:

  1. Correct the problems in the PHP scripts (imho the best way)
  2. Modify the PHP source code so it reports itself as "mod_php52.c","mod_php53.c"
  3. Run it as CGI where needed Check it out here

You can also run 2 servers on different ports and use a proxy


Yes it is possible. You should use fastcgi mode by "FcgidWrapper" directive in apache configuration. This way you can define different fastcgi handler daemons for different url extension, path, or even virtual hosts. In the background, each fastcgi daemon then can easily executes different php versions.