CGI PHP Scripts: Error "Premature end of script headers"

From: Date: Wed, 18 Apr 2001 00:34:37 +0000
Subject: CGI PHP Scripts: Error "Premature end of script headers"
Groups: php.general 
Request: Send a blank email to php-general+get-49094@lists.php.net to get a copy of this message
Hello. I'm trying to write a CGI PHP script which should do nothing, but print one line. PHP is in /usr/bin/php. The script I've made is: #!/usr/bin/php <?php echo "42"; ?> When I run this script (called »ez«) form the commandline, I get the expected output, ie.: [alex@www cgi-bin]$ ./ez X-Powered-By: PHP/4.0.4 Content-type: text/html 42 But when I run the script via a browser, like http://localhost/cgi-bin/ez, I get an internal server error and in apache's error log the line "Premature end of script headers" What am I doing wrong, what have I forgotten, and how to do it right? Thanks, Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 1 day 2 hours 23 minutes

« previous php.general (#49094) next »