Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Premature end of script headers <- what is this?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm using apache1.3.12 with mod_ssl and mod_php4 (4.0.2) and I get this problem no matter what I do:
[Wed Sep 13 21:50:28 2000] [error] [client 63.252.212.201] Premature end of script headers: /
I installed apache exactly as told in

test.php contains:
?php phpinfo(); ?
(with brackets on each side)

This is on a slackware7.1 machine (linux2.2.16)

What is causing this problem and how can I fix?
 
Hi,

I have the same problem, and can't figure out :(

The only difference is that I built PHP 4.0.2 as a stand alone cgi, not as Apache module.
When I run php in a shell whith a test.php containing <? PHPINFO(); ?> everything's fine: the output is &quot;Content-type: text/html&quot; followed by two \n and then the html stuff. If I run the same test.php in a browser (over Apache) the end will be an &quot;Internal server error&quot;, and a line in the httpd errorlog: &quot;Premature end of script headers: /home/...&quot; %-(

Using PHP 3.0.16 built with the same config on the same machine, with the same Apache... guess! Everything is OK.

Have an idea? Please share with me!

bandi [sig][/sig]
 
In short, this means that the server is not sending the correct header information for this file.

Make sure you have httpd.conf configured correctly for PHP file handling.

Also, if you are using the CGI version of PHP, then make sure you have the shebang line inserted correctly in your script (must be the first line of the file). This should be something like '#!/usr/local/bin/php -q'. It should point to your executable for PHP.

One more thing, you don't necessarily need to have your scripts in the cgi-bin in order to have your scripts execute. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top