Re: [PHP] php as cgi script

From: Nicole Lallande (nicole_at_nmlconsulting.com)
Date: 11/28/03


Date: Fri, 28 Nov 2003 11:05:51 -0800
To: Ivone Uribe <ivoneu1@yahoo.com>

Ivone --

You are using a PERL invocation for php. PHP scripts begin with
<?php

the # sign is a comment in PERL - not in PHP.

To run php as cgi you need to install the php cgi version (as opposed to
the apache modular installation.) That will allow you to run cgi
scripts on the command line.

http://www.php.net/manual/en/install.commandline.php

Best regards,

Nicole

Ivone Uribe wrote:

>Hello all!
>
>I have this problem:
>
>I need to run a php
>(http://xx.yy.zz/cgi-bin/pruebacgi.php) that contains
>that line
>
>#!/usr/local/bin/php -q
>I get it an error from my apache log:
>malformed header from script. Bad header= php
>[options] -r <cod
>e>: /www/cgi-bin/pruebacgi.php
>I hope someone can help me! I don't know what can I
>do.
>
>In fact if I run any php that have this line
>#!/usr/local/bin/php
>I get an error like that
>Premature end of script headers:
>/www/cgi-bin/pruebacgi.php
>
>
>
>I have installed the php4.3.3 and apache 1.3.28.
>
>I configured the php with this line
>./configure --with-mysql
>--with-apache=../apache_1.3.28 --enable-track-vars
>
>Do I need to configure some else in my apache or php
>configuration file. Whan can I do to solve this
>problem?
>
>
>Thanks in advance!!!!!!!!
>KISSES
>Ivone
>
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Free Pop-Up Blocker - Get it now
>http://companion.yahoo.com/
>
>
>



Relevant Pages

  • Re: Web Server Botnets and Server Farms as Attack Platforms
    ... insecure web application written in PHP, although attacks for other ... The main reason for this is that many different PHP applications are ... and you've found your way to execute shell code on the remote web server. ... those scripts were put in place. ...
    (Bugtraq)
  • Re: [Full-disclosure] Web Server Botnets and Server Farms as Attack Platforms
    ... insecure web application written in PHP, although attacks for other ... The main reason for this is that many different PHP applications are ... and you've found your way to execute shell code on the remote web server. ... those scripts were put in place. ...
    (Full-Disclosure)
  • Re: Post with redirect?
    ... redirection...and how to do a post from php (which you said was ... I said it was impossible to redirect from PHP. ... my claim is NOT that you can redirect post data. ... And all you do is post scripts you've collected off the internet. ...
    (comp.lang.php)
  • php mail() sendmail hanging
    ... When hitting php pages that use the mailfunction, I get a 5 second hang ... dnl Uncomment to allow relaying based on your MX records. ... This can allow sites to use your server as a backup MX without ... You can redirect all of the output of your scripts to a function. ...
    (freebsd-questions)
  • Trouble with system() function
    ... PHP manual and have tried everything there, ... tried it on 2003 Server, ... You can redirect all of the output of your scripts to a function. ... A warning appears if the specified function is not defined, ...
    (comp.lang.php)