Page 1 of 1

Install php4 as cgi in apache 2

Posted: Sat Jun 16, 2007 8:49 am
by joiguru
Hi
I have fedora 7 with apache 2 and php 5 preconfgured !!
php5 is installed as apache module !!
So i decided to install php4 as cgi handler !!

I installed php 4.4.7 with the following set of commands !!

Code: Select all

./configure --prefix=/opt/php4 --enable-discard-path --enable-fastcgi --with-layout=GNU --with-openssl --with-kerberos --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl  --with-dom --enable-filepro --enable-ftp --with-gd --with-gettext  --enable-mbstring --with-mime-magic --with-mysql --enable-memory-limit --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --enable-sockets
make
make install
cp php.ini-dist /opt/php4/etc/php.ini
i changed the php.conf file to look like this (its included by the httpd.conf file) !!

Code: Select all

LoadModule php5_module modules/libphp5.so
ScriptAlias /php4/ "/opt/php4/bin/"
Action php4-script /php4/php
AddHandler php5-script .php .php5
AddHandler php4-script .php4
AddType text/html .php .php4 .php5
But the following index.php4 does not work as cgi !!

Code: Select all

<?php phpinfo(); ?>
when accesing it i get the following error

Code: Select all

Parse error: syntax error, unexpected '[' in /opt/php4/bin/php on line 1005

Posted: Sat Jun 16, 2007 11:16 am
by superdezign
You see like a very excitable person !!

Why bother having both active?

Posted: Sat Jun 16, 2007 12:04 pm
by joiguru
superdezign wrote:You see like a very excitable person !!
Was that a sarcastic comment ??
superdezign wrote:Why bother having both active?
I need to have both php4 and php5 to test my apps !!
Some of which need to work on both !!
Moreover i didnot want another installation of apache !!
And form the ideas i got from the web I thought this would be a quick solution !!

Posted: Sat Jun 16, 2007 12:33 pm
by superdezign
Sarcastic? !!
Me? !!
No. !!

:-p

Try this.

Posted: Sat Jun 16, 2007 6:45 pm
by joiguru
That links onlyworks for Debian and Ubuntu !!
I am using Fedora 7 !!