running php scripts as cgi

Alexander Dalloz ad+lists at uni-x.org
Mon Apr 4 15:06:13 UTC 2005


Am Mo, den 04.04.2005 schrieb Ankush Grover um 16:49:

> I want to install a software on FC3 and that software requires to run
> some scripts.I tried to run those scripts from browser but was not
> successful.In the documentation of that software it is written I have
> to  configure PHP scripts to run as CGI in Apache.Please tell me how
> to configure PHP scripts run as CGI in Apache.

> Ankush

Running PHP embedded into Apache as a module (default Fedora setup with
correct handler set for .php files), a file with suffix .php and content

<?php .... ?>

is treated to be a PHP file and handled so.

If you want to use PHP as a script language for CGI the file has to have
a shebang line

#!/usr/bin/php

like with all other script languages. You too need a Apache config line
like

AddHandler    cgi-script    .php

to let Apache know that files with suffix .php shall be treated as CGI
files. Other CGI setups are possible, like the default Fedora setup
where files with suffix .cgi inside the CGI alias directory are treated
as CGI scripts automatically.

For general CGI scripting hints please read

http://httpd.apache.org/docs-2.0/howto/cgi.html

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG http://pgp.mit.edu 0xB366A773
legal statement: http://www.uni-x.org/legal.html
Fedora Core 2 GNU/Linux on Athlon with kernel 2.6.10-1.771_FC2smp 
Serendipity 17:00:19 up 5 days, 14:26, load average: 0.25, 0.31, 0.35 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20050404/4b38d35e/attachment-0001.sig>


More information about the fedora-list mailing list