apache Error 500 (Premature end of script headers)

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
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

apache Error 500 (Premature end of script headers)

Post by newmember »

Hi

when i'm accessing my site via http://nila.lunarpages.com/~myname/ i'm getting:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
...
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

--------------------------------------------------------------------------------

Apache/1.3.33 Server at nila.lunarpages.com Port 80
also in error log i see:
Premature end of script headers: /home/myname/public_html/index.php
i searched web about this error and found that this error can arise from limited file permissions, incorrect ftp upload mode , newlines conventions or not using content type header.

i verified all these things: files are saved with unix newline style,
upload mode also was correct(filezilla) and finally i set up 755 owner permissions and correct content-type.

now, regarding the content of index.php, i tried something like:

Code: Select all

<?php
header("Content-type: text/html");
phpinfo();
?>
and

Code: Select all

<?php
echo('ok');
?>
or simply:

Code: Select all

some text here
no matter what i'm getting the same 500 error and the same error message in log.

What else can i do?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: apache Error 500 (Premature end of script headers)

Post by Chris Corbyn »

newmember wrote:What else can i do?
Does plain HTML load OK or is it just when PHP is being used?

I think we need to identify if this is Apache or PHP that's having the problem...

Also, try your files in another directory on the same server and see how they load then ;)
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

Post by newmember »

i tried now:
<html>
<head>
<title>Welcome</title>
</head>
<body>
</body>
</html>
and i tried to put another index.php in different directory

still nothing changes.. i get the same "server internal error" page
:?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

newmember wrote:i tried now:
<html>
<head>
<title>Welcome</title>
</head>
<body>
</body>
</html>
and i tried to put another index.php in different directory

still nothing changes.. i get the same "server internal error" page
:?
Was this is .html extension or a .php extension... I want to know what happens when the page is not parsed by PHP at all.
It sounds from what you are telling me however that the apache installation needs setting back up from scratch but try with a plain .html extension first please.
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

Post by newmember »

ok, i tried the same index.html and it worked... no errors...

so what that all means?
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Re: apache Error 500 (Premature end of script headers)

Post by dethron »

d11wtq wrote:I think we need to identify if this is Apache or PHP that's having the problem...

It means d11wtq identified the problem :))
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

Post by newmember »

so you think i should write an email to tech support?
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

1) When did this problem happen first?
2) Before that, had you used a .php file?
3) Is it a dedicated server or what?
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

Post by newmember »

this site is hosted by lunarpages.com.
i'm did all the major work on my home machine and just today i decided to upload the almost finished work for final touches.
... and the error appeared from the beggining.
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

newmember wrote:so you think i should write an email to tech support?
email to the tech support :(
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

Post by newmember »

i already got a reply from them(fast) :D
Unfortunately, the temporary url will not work with the suPHP servers we use at Lunarpages. You will either need to wait until the domain name has propagated or request a temporary subdomain off of lunarpages (in the form subdomain.lunarpages.biz or .info) for php pages to function.
...and i "wasted" a few hours on trying figuring out what could the problem... :P
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post by dethron »

Qui-Gon Jinn: Patience, my blue friend.
Post Reply