Page 1 of 1

chmod, premature end of script headers error, etc: HELP!

Posted: Thu Dec 05, 2002 12:58 pm
by Genteel Beaux
I created a website at home and it works fine. But after uploading my files to my hosting company, I got the following error:

Server error!

The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: main.php

If you think this is a server error, please contact the webmaster.

Error 500
So I contacted the companies customer service support and was told the .php files must be executable - otherwise they will not run. You must chmod 755 the script.

Not knowing what any of that meant, I did a search here on chmod and I tried just about every solution I could find. I put:

Code: Select all

<?php

chmod("main.php", 0755);

?>
in my code in the main.php file. Then I uploaded it to my hosting server and I still get the same error. The book I have is very vague on the subject of chmod and seems to steer more towards UNIX. I don't know anything about UNIX. I am running Windows XP Professional.

I haven't had this much trouble with ASP. So what am I doing wrong?

Posted: Thu Dec 05, 2002 1:32 pm
by volka
probably you've used a FTP-client to upload your scripts. This program should offer a chmod-command. Use this to change the permissions.
You would have the same troubles if the ASP-Parser/Webserver couldn't read the script-file ;)

Posted: Thu Dec 05, 2002 1:36 pm
by Genteel Beaux
You are right. I am currently using the built-in FTP client that came with Dreamweaver MX. I didn't see anything that referenced a chmod-command, but I will research the product to make sure. If it doesn't offer it, what should I do?

Posted: Thu Dec 05, 2002 7:22 pm
by volka
if found this: http://www.cgi-interactive.co.uk/dreamw ... ripts.html
should be applicable for php-files (for any file), too

Posted: Thu Dec 05, 2002 10:23 pm
by Genteel Beaux
Thanks a lot. It works now.