Page 1 of 1

How do you enable PHP4 and 5

Posted: Fri Jul 11, 2008 4:52 pm
by alex.barylski
Can they run at the same time or do they conflict? How do you set it up so they can run on the same machine, but not at the same time?

Re: How do you enable PHP4 and 5

Posted: Fri Jul 11, 2008 5:46 pm
by Christopher
I think people who run them simultaneously run one as a CGI. I suppose you could just mod_rewrite to 'cgi-bin/php' instead of 'index.php' and clean URLs would be the same.

Re: How do you enable PHP4 and 5

Posted: Fri Jul 11, 2008 7:18 pm
by Ollie Saunders
You can run then in the same apache as long as you use shared object and disambiguate them with .php4 and .php5 extensions (or whatever takes your fancy)

Re: How do you enable PHP4 and 5

Posted: Tue Jul 15, 2008 7:01 am
by alex.barylski
I think people who run them simultaneously run one as a CGI. I suppose you could just mod_rewrite to 'cgi-bin/php' instead of 'index.php' and clean URLs would be the same.
Hmmm...interesting...didn't even think of that one...
Ollie Saunders wrote:You can run then in the same apache as long as you use shared object and disambiguate them with .php4 and .php5 extensions (or whatever takes your fancy)
Same Apache instance...but how do you tell Apache to run PHP4 or PHP5? Requiring the extension would be a PITA...what happens to legacy PHP applications? Do I change their extensions from php4 to php5? It owuld be ideal if I could put php4 applications in a php4 directory and php5 applications in another directory.

Re: How do you enable PHP4 and 5

Posted: Tue Jul 15, 2008 7:08 am
by Eran
One solution to end them all: http://hurring.com/scott/howto/php4_and_php5/

Re: How do you enable PHP4 and 5

Posted: Sun Aug 03, 2008 3:56 pm
by Alan01252
You can also do this by placing a .htaccess file in the directory with the line

AddHandler application/x-httpd-php4 .php

obviously substitute php4 for php 5 depending on what you want the scripts in the directory to use.