Install php4 as cgi in apache 2

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
joiguru
Forum Newbie
Posts: 3
Joined: Sat Jun 16, 2007 8:37 am

Install php4 as cgi in apache 2

Post 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
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You see like a very excitable person !!

Why bother having both active?
joiguru
Forum Newbie
Posts: 3
Joined: Sat Jun 16, 2007 8:37 am

Post 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 !!
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Sarcastic? !!
Me? !!
No. !!

:-p

Try this.
joiguru
Forum Newbie
Posts: 3
Joined: Sat Jun 16, 2007 8:37 am

Post by joiguru »

That links onlyworks for Debian and Ubuntu !!
I am using Fedora 7 !!
Post Reply