HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   php4 and php5 at same time (http://www.howtoforge.com/forums/showthread.php?t=12460)

findafriend 2nd May 2007 17:41

php4 and php5 at same time
 
Hi

I have had a look where Till suggested that you run php4 as a cgi object.

I have postnuke 0.7.63 installed on a webserver and want to transfer it to a new server with ispconfig.

It is just not possible to run php4 as php5 is installed as default.

Is the only solution to run php4 as described in a thread here today ?

Why not make ispconfig configured, so you can tick php4 or php5 off in the controlpanel for the specific domain, then it would really help you solve a lot problems.

Sincerely

Mogens

till 2nd May 2007 20:48

Quote:

It is just not possible to run php4 as php5 is installed as default.
This is assumption not correct. I recently installed it for a customer: php as mod_php + php4 as cgi.

1) Install the php4-cgi package from your linux distribution.

2) To enable PHP4 in a website, add these two lines in the
apache directives field of the website:

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


And then make sure that the following options are disabled:

CGI-Scripts
Standard CGIs
PHP Scripts
PHP Safemode

findafriend 2nd May 2007 21:05

Hi Till

Thanks again for your great help.
You have just helped me installing ispconfig on domain : easywebhost.dk
How do i install the modules without smash my ispconfig installation ?
Is it enought to use the normal debian commands :

apt-get php4-cgi install

Sincerely

Mogens

till 3rd May 2007 09:19

Quote:

Is it enought to use the normal debian commands :

apt-get php4-cgi install
Yes, this should work.

melwood 21st June 2007 21:35

Hi,

I have a debiab etch server installed after the "perfect setup"-HowTo.
I Installed php4-cgi with apt-get intall php4-cgi

Added the following to the apache directives field of the website

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

And disabled the follwing options within the specific web:

CGI-Scripts
Standard CGIs
PHP Scripts
PHP Safemode

Now all I see is the php source code. Did I miss something?

melwood

till 21st June 2007 23:20

This will only work depends if you have a binary named php in your global cgi-bin directory.

For example the php4 binary might be named php4 or php4-cgi and not php, so the rsulting code will be:

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

or:

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

melwood 22nd June 2007 15:11

Quote:

Originally Posted by till
This will only work depends if you have a binary named php in your global cgi-bin directory.

For example the php4 binary might be named php4 or php4-cgi and not php, so the rsulting code will be:

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

or:

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

Okay, there is a /usr/lib/cgi-bin/php4 on my system, so I added

Action php4-cgi /usr/lib/cgi-bin/php4
AddHandler php4-cgi .php

But now I get a 404: Fehler 404 - Datei nicht gefunden!

Also tried

Action php4-cgi /cgi-bin/php4

as I'm not sure if I have to use the full path there, but the same result...

There is also a /usr/bin/php4-cgi but this isn't working either.

HTML-files are shown correctly...

The error log says: [Fri Jun 22 15:48:13 2007] [error] [client 74.6.28.226] File does not exist: /var/www/web17/web/cgi-bin



melwood

melwood 22nd June 2007 16:44

Okay, had to set

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

in apache2.conf

now it works. Thanks for the help


All times are GMT +2. The time now is 16:51.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.