Reminder: You *Can* Run PHP4 And PHP5 On The Same Box At The Same Time

Posted by Stuart Herbert @ 5:28 PM, Fri 21 Apr 06

Filed under: PHP

2 Comments

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.

Thanks, Andreas!

2 Comments

  1. Toby says:
    April 21st, 2006 at 7:52 pm

    Just use Lighttpd and you can run as many PHP versions as you like in 1 server. :)

  2. lb says:
    April 22nd, 2006 at 12:06 pm

    I found the following article the easiest to complete doing the same thing:

    http://cms.227net.com/apache/run_php4_and_php5_concurrently

Calendar

April 2006
S M T W T F S
« Mar   May »
 1
2345678
9101112131415
16171819202122
23242526272829
30