CGI version of PHP not working
[email protected] (Victor) Wed, 07 Jun 2000 11:34:30 -0400
| Newsgroups | php.version4 |
|---|---|
| Message-ID | <[email protected]> |
I am running a php compiled as a CGI executable. 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 Both scripts work fine 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 finds all libraries. (plus, it does run from command line, so that doesn't seem to be a problem). Here is the output when I run test.cgi (php version) from command line: $ ./test.cgi X-Powered-By: PHP/4.0.0 Content-type: text/html Hello World $ What else could cause this??? I tried running with -q switch and printing Content type myself, but that didn't help either. So I recompiled PHP (without the --enable-force-cgi-redirect directive, as I think it's not necessary when php is in /usr/local/bin anyway) ./configure \ --disable-debug \ --enable-safe-mode \ --enable-trans-sid \ --enable-track-vars \ --with-mysql \ --enable-discard-path Now it runs, but says this (in my browser, not error log): No input file specified. Thanks, Victor