PDA

View Full Version : ubuntu php4 and 5 in same machine using apache2


Vege
10-08-2006, 06:11 PM
Installing php4 and php5 under apache2 while using kubuntu?

i dont manage to understand how i setup my apache2 so that php4 files are .php and php5 files are php5

There is a nice document about this in: http://www.howtoforge.com/apache2_with_php5_and_php4

But when i try to switch php4 and php5 places in that tutorial, it dont work :confused:

http://paste.ubuntu-nl.org/26009/
this is my altered/added lines in apache2.conf

when i run .php5 named file that includes phpinfo() code, ill get php4 specific information?

Anyone?

nox-Hand
10-10-2006, 10:20 AM
I admit that I have never set up an Apache server, so I doubt this will be of much use...



You paste that you have set this in apache2.conf:

DirectoryIndex index.html index.cgi index.pl index.php index.php5 index.xhtml
where it says on the page that you shoud define this:
DirectoryIndex index.html index.htm index.shtml index.cgi index.pl index.php index.php4 index.xhtml

That should not kill it as far as I know, but this next peice might:

It says that you should add this to your apache2.conf:

AddHandler php-script .php4
Action php-script /cgi-bin/php4

where it in the pastebin says you did this:

AddHandler php-script .php5
Action php-script /cgi-bin/php5

The purpose of it being php4 in apache2.conf according to the guide is:

This will make sure that PHP files with the extension .php4 are executed as CGI. PHP files with the extension .php will be run by the Apache2-PHP5 module.


So, is that it? Please do tell ( and rep me if it works ;) )! I hope it helps!

Vege
10-10-2006, 12:29 PM
Yes, but my orginal intention was to use .php for php4 and .php5 for php5.

And actually the code i gave was correct and made it work. Somehow apache restart didin't work or I had old versions in cache.

now i can use both versions in same machine.

nox-Hand
10-10-2006, 12:32 PM
Righto, jolly good!

erisco
10-10-2006, 03:20 PM
Leave it to the mysterious yet miraculous human error to create something right ;)

nox-Hand
10-10-2006, 03:33 PM
I shall indeed - and here I thought I could help xD