Page 1 of 1

php5 and php4 on the same server

Posted: Wed Sep 17, 2003 4:41 pm
by Heavy
Anyone have experience using php4 and php5 on the same apache server under unix?

I want to try it out, but have only server computer. I would like to have both systems on the same apache server.

How can I do that?
Anyone done that and run into problems?

Posted: Wed Sep 17, 2003 6:11 pm
by Cruzado_Mainfrm
i think you can,
in the httpd.conf, where you have your directives that specify where is the PHP interpreter located, use something like this:

Code: Select all

# Specify both php4 and php5 locations
ScriptAlias /php4/ "C:/usr/local/php4/"
ScriptAlias /php5/ "C:/usr/local/php5/"

# Only a little modification
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
# Note the end of the line below
AddType application/x-httpd-php .php .php4 .php5
AddType application/x-httpd-php-source .phps

# Script Handlers
AddHandler php3-script .php3
AddHandler php5-script .php5
AddHandler php-script .php .php4

# Leave this two with php4 if you want
Action php3-script /php4/php.exe
Action php-script /php4/php.exe 

# Modification for php5
Action php5-script /php5/php.exe
and i think that's it :D
edit it to fit your needs of course

Posted: Wed Sep 17, 2003 6:15 pm
by JAM
Cruzado_Mainfrm wrote:i think you can,
in the httpd.conf, where you have your directives that specify where is the PHP interpreter located, use something like ... <cut>
Just wanted to agree with Cruzado_Mainfrm and leave a note that it should work, as I once tested this between php 3.x & 4.x.

Posted: Wed Sep 17, 2003 6:19 pm
by Cruzado_Mainfrm
the only concern is the php.ini file, but that is for windows, i don't know what file UNIX might use..., if it does :D

Posted: Thu Sep 18, 2003 1:58 am
by Heavy
Thanks guys.
Cruzado_Mainfrm wrote:the only concern is the php.ini file, but that is for windows, i don't know what file UNIX might use..., if it does :D
Maybe if I recompile one of them with some special configure directive, to make that version look for php.ini somewhere else.

Posted: Thu Sep 18, 2003 2:01 am
by Heavy
I actually believe one should check out for some more things, like where the different very alike systems store their session data etc, so a collision could be avoided.

I don't know much about this, but I guess it should be possible.