PDA

View Full Version : Premature end of script headers


jbenalluch
1-3-02, 08:55 AM
what does this mean?

[Wed Jan 2 20:50:07 2002] [error] [client 67.161.44.26] Premature end of script headers: /www/p/pi2korg/cgi-bin/tst.php

odieone
1-3-02, 09:04 AM
Means you have an error in the script. More than likely in the base url or something.

jbenalluch
1-3-02, 09:07 AM
the script basically looks like this:


<?php
echo "test";
?>


i have also tried to put the #!/usr/local/bin/php as said in the faqs and i still get the same problem...

NathanRX7
1-4-02, 02:51 AM
You must upload it as ASCII and chmod 755 it.

jbenalluch
1-4-02, 03:30 AM
Thanks for answering!

That works fine when i upload it in the htdocs directory.
I have tried to put in a subfolder the same way (uploading in ascii, changing to 755) and when i try opening the script, i get the same premature end of scripts header message in the error_log
(i have added the #!/usr/local/bin/php line at the top of the file...)

do you have any ideas of what is going on?
thanks

NathanRX7
1-4-02, 04:13 AM
Make sure the actual directory is chmod 755 as well.

jbenalluch
1-4-02, 04:38 AM
I have tried using the same script that worked in the root folder, changed the mods of the file and folder to 755 and added the line #!/usr/local/bin/php to the top of the file....

What am i doing wrong?

I have read certain thingas about putting the #!/usr/local/bin/php line into the .htaccess file... should i do that? what is the directive i have to use for making that?

thanks

PSteele
1-5-02, 08:43 AM
You have *got* to make sure your files are ASCII. I spent over an hour trying to get a simple PHP script to work. I even went so far as to remove any scripting -- it was straight HTML! And it still didn't work.

Then I checked my FTP client and noticed it was uploading in binary mode. I changed to ASCII and everything worked fine.

Here's something to check. Are you developing your script on Windows? If so, the size of the PHP file on your machine and the size of the file on your web site should be different! If they are the same size, the file was sent binary and will not work.