Re: #!/path/to/php at top of output from CGI
| From: | Jeff Davis | Date: | Fri, 05 Jan 2001 05:56:06 +0000 |
| Subject: | Re: #!/path/to/php at top of output from CGI | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32827@lists.php.net to get a copy of this message | ||
If i add the -q option it just says "No input files specified" under CGI and
at the shell outputs as expected, minus the headers.
The php.cgi script follows:
#!/usr/local/bin/php
<? phpinfo(); ?>
That's all I have in the file; just used for testing. You're right, it does
look like the file is being interpreted early, but I have no idea how/why.
Also, if I remove the part at the top I get an internal server error, so it is
not as if I don't need it. I really appreaciate all your advice. I am just
completely bewildered here...I have been messing with this for way too long.
Regards,
Jeff Davis
On Thu, 04 Jan 2001, you wrote:
> My aplogies - I didn't take note of the fact that you'd said you'd named it
> php.cgi earlier - I wouldn't have made the suggestion about an existing
> handler.
>
> Try changing #!/usr/local/bin/php to #!/usr/local/bin/php -q and see if it
> still gets printed, and even actually works instead of causing an 'Internal
> Server Error' thorugh lack of headers.
>
> Also, ensure the php.cgi script does not include any other scripts that
> might have the same shell escape sequence at the top.
>
> It looks like the script is being interpreted by the Php module somehow
> before the shell escape at the top is even used, or considered.
>
>
> ----- Original Message -----
> From: "Jeff Davis" <jdavis@wasabimg.com>
> To: "Jason Brooke" <jason@qgl.org>
> Cc: <php-general@lists.php.net>
> Sent: Friday, January 05, 2001 2:31 PM
> Subject: Re: [PHP] #!/path/to/php at top of output from CGI
>
>
> > Hmm.. I tried a new extension that shouldn't have anything associated with
> it
> > (.pcgi). Also, perl/C work under the .cgi extension. Stranger yet, if I
> do:
> > ~/www$ ./php.cgi > out
> > the file 'out' has no '#!/usr/local/bin/php' in it. However if I go to
> > the
> > browser and execute the CGI thru the webserver it still puts that at the
> top
> > (as if it was plaintext, like you said, because it is outside the <??>).
> Then,
> > the phpinfo() goes right below it as if nothing was wrong (it outputs
> fine,
> > with all the information about php and my environment).
> >
> > I have the module installed, but I don't think that should make a
> difference
> > right?
> >
> > Thanks very much, it is sort of important that I figure out how to get the
> CGI
> > to work.
> >
> > Jeff Davis
--
Jeff Davis
jdavis@dynworks.com
http://dynworks.com