Posted by Stuart Herbert @ 5:28 PM, Fri 21 Apr 06
Filed under: PHP
Today has served as a timely reminder to me that not everyone understands that it’s perfectly possible to have both PHP4 and PHP5 installed in Apache at the same time. A lot of folks just stop when they learn that you can’t load mod_php4 and mod_php5 at the same time into Apache. There’s no solution in the excellent PHP Manual that I could spot this afternoon (maybe I’ve just missed it?), and a lot of folks just don’t get any further along than that.
(I think it’d be very interesting if it was possible to work out just how much this one issue is holding up wider adoption of PHP5)
Andreas Korthaus has kindly written some instructions explaining several different ways to configure Apache to work with PHP4 and PHP5 on Gentoo. He’s covered running one as an Apache module + one as CGI, as well as running one as an Apache module + one as CGI via mod_suphp. There’s also a list of other approaches with links for further information. Although the document was written for Gentoo, it should be easy enough to translate the instructions into your favourite distro.