You are here: Re: PHP as CGI script in CGI-BIN? « PHP Programming Language « IT news, forums, messages
Re: PHP as CGI script in CGI-BIN?

Posted by Andy Hassall on 09/21/05 20:28

On Wed, 21 Sep 2005 15:24:05 GMT, cmarvelNOSPAM@nethere.com (Keith) wrote:

>All:
> I am having problems trying to run some php scripts in cgi. I have Apache 2.0+ and PHP 4.3. Perl works fine
>with CGI and PHP works find as an Apache module. Whenever I attempt to run the php script through a URL with the
>cgi-bin, it asks if I want to open or download the file. Cgi files execute fine though. Can anyone think of anything I
>might be missing in any of the conf files?
> Included is an example of one of my php scripts. Thank you for any advice.
>
>#!/usr/bin/php -q
>
><?php phpinfo(); ?>

The -q flag suppresses the Content-type header, IIRC. You don't want to
suppress this, you want to let PHP send it unless you are specifying one
yourself with header().

Also, make sure the PHP you're referring to is the CGI version of PHP - as
there is a separate command-line version as well (the "CLI" SAPI). Having not
had much experience running as CGI (I always use the webserver module version)
I can't say for sure if these two are fundamentally different, but they
certainly appear to be built separately at least in PHP 5.

What does "php -v" say?
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация