httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lllllll Gabor <>
Subject RE: [users@httpd] Sometimes getting 'Premature end of script...'
Date Mon, 01 Aug 2005 12:43:13 GMT
Thx for the advices, Owen!

I use MySQL, I read and write files in these scripts. User input
is not really intresting. It comes at the same values sometimes.

I also noticed that this error comes when I use Php-MyAdmin!
Different requests make these errors.
(Anyway I looked at its code and the header is correct.
I am sure there should not be errors like this in the MyAdmin scripts.)
So I guess that must be a problem of misconfiguration.

Anyway if someone can answear to me the following things it can
be useful:
1, Is it possible that MySQL 5.0.0a (alpha!) makes the problem?
    If so why I get php header error?
2, Can SafeMode solve such problems? If I turn it on makes the
    scripts more reliable? (Speed is not really needed in my case.)
3, Can u suggest some links about how to make the server more
    reliable? Programs would be also nice.


Boyle Owen <> írta:
> > Can someone help me to solve this?
> > 
> > Usually when I browse my php scripts they are fine.
> > But sometimes I get an 500 (internal server) error because
> > of 'Premature end of script headers: php.exe'.
> This means that the PHP code failed before it got to the bit where it 
prints the response header ("content-type: text/html\n\n"). There is an 
occasional problem with your code which is not properly trapped. Do 
you access a DB?, write to a file? read from a file? do any calculations 
using user input? Any of these (and others) can cause a failure which 
depends on user input. To debug:
> - Look in the access log and find the request which corresponds to 
the error (use the timestamp to cross-reference). Try to reproduce the 
fauilure by re-issuing the same request (ie, same user parameters).
> - If you need more information, activate ScriptLogging - see docs for 
> - Generally, don't trust user input - they can submit anything (words 
instead of numbers, numbers instead of words, even entire programs!)
> > 
> > I read the faq but found only a few things about this.
> > 
> > How can I make it to work always?
> You have to fix the bug in the PHP code.
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored. 
> > I use these:
> >   Apache 2.0.48
> >   Win XP
> >   Php 4.3.5
> > 
> > I already increased the "ThreadsPerChild" setting. Now it is 
> > better but
> > not perfect.
> > I also have the following settings in httpd.conf:
> > ScriptAlias /php/ "d:/Apache2/php/"
> > AddType application/x-httpd-php .php
> > Action application/x-httpd-php "/php/php.exe"
> > 
> > I would be happy about any ideas or comments about this.
> > 
> > Thanks,
> >   Gabor

[freemail] extra 1GB-os postafiókkal, Önnek már van?

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message