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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Genteel Beaux
Forum Commoner
Posts: 28
Joined: Wed Nov 13, 2002 4:07 pm
Location: Alabama

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

Post 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?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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 ;)
Genteel Beaux
Forum Commoner
Posts: 28
Joined: Wed Nov 13, 2002 4:07 pm
Location: Alabama

Post 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?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

if found this: http://www.cgi-interactive.co.uk/dreamw ... ripts.html
should be applicable for php-files (for any file), too
Genteel Beaux
Forum Commoner
Posts: 28
Joined: Wed Nov 13, 2002 4:07 pm
Location: Alabama

Post by Genteel Beaux »

Thanks a lot. It works now.
Post Reply