[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: running php scripts as cgi



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 

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]