Re: CGI-executable Apache
| From: | Victor | Date: | Tue, 06 Jun 2000 20:27:42 +0000 |
| Subject: | Re: CGI-executable Apache | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1145@lists.php.net to get a copy of this message | ||
Well, I am trying to get it to work using just the #! directive.
I am running a php executable compiled for CGI access.
I try to run this (saved in test.cgi)
#!/usr/local/bin/php
<? print "hello world\n"; ?>
I get this error
[Tue Jun 6 16:18:02 2000] [error] [client xxx.xxx.xxx.xx] Premature end of script
headers: /data/www/cgi-bin/test.cgi
Same script, written like this
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "hello world\n";
Works without a problem
It works from command line when I am logged in as nobody and when I am logged in as
root. I explicitly specified the path to php.ini, but nothing changed. Could a
directive in php.ini cause this? Ldd on php find all libraries. (plus, it does run
from command line, so that doesn't seem to be a problem).
What else could cause this???
Victor
Teodor Cimpoesu wrote:
> Hi Victor!
> On Mon, 05 Jun 2000, Victor wrote:
>
> > My error log is what I posted
> > Premature end of script headers: /data/www/virtual_host/cgi-bin/test.cgi
> > I don't think I have a safe_exec_dir defined anywhere; is this an Apache
> > directive?
> nope, php one.
>
> Well, first off, probably you have something like
> AddHandler cgi-script .cgi
> and
> ScriptAlias /cgi-bin/ /path/to/cgi-bin/ right?
> and you want test.cgi to use the hash-bang feature to invoke php,
> maybe you should try instead installing php as per docs, with
> the following directives ...
> then remember, you cannot have both of them,i.e. a foo.php under
> a path declared as ScriptAlias,or with ExecCGI option won't work.
> [least IIRC]