Re: Internal server error on PHP syntax error?

From: Date: Mon, 13 Feb 2012 16:55:19 +0000
Subject: Re: Internal server error on PHP syntax error?
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-57830@lists.php.net to get a copy of this message
On Mon, Feb 13, 2012 at 5:50 PM, Jakov Sosic <jakov.sosic@srce.hr> wrote: > Hi. > > I don't know if this is the right group to ask this kind of question, but > if it isn't please excuse my french ;) > > As far as I can see, PHP does not report back to Apache error 500 in case > of a syntax error in code but displays empty page. For example this code: > > <?php foobar(); > > always returns empty page. > > I was curious, so I googled little around and found this old entry from > this mailing list: > > > http://marc.info/?l=php-**internals&m=124043575308005<http://marc.info/?l=php-internals&m=124043575308005> > > > So if that's true, and if I understand it correctly, there is no way for > Apache to display error 500 in case of PHP syntax error? > > It is implemented already, php will report HTTP 500 on fatal errors, except if the headers were already sent. And I also remember a php/xdebug bug, which caused the headers to be sent see http://bugs.xdebug.org/view.php?id=587 and https://bugs.php.net/bug.php?id=50921 Derick fixed it in 5.4 So I would suggest you to double-check that you aren't using xdebug when you experience the problem, and that you don't send out the headers before your code blows up. -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.internals (#57830) next »