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
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?
--
Jakov Sosic
www.srce.unizg.hr
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=124043575308005http://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
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.
I know about xdebug bug, and xdebug is not even installed. I have same
issue on CentOS v5 with original 5.1 RPMs, v5.2.17 from Atomic, v php53
5.3.3 from CentOS 5.7, and finally on Debian with php v5.2.6.
I've tried this code:
<?php
ini_set('display_errors', 0);
$x = y();
?>
and I get this in logs:
IPADDR - - [13/Feb/2012:18:03:52 +0100] "GET /~username/test/ HTTP/1.1"
500 20 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20100101
Firefox/10.0.1"
so, 500 headers are returned but internal server error page is not
displayed. All I get is a blank page.
So apache directive "ErrorDocument 500 /500.html" is useless in this case.
--
Jakov Sosic
www.srce.unizg.hr
Am 13.02.2012 18:08, schrieb Jakov Sosic:
and I get this in logs:
IPADDR - - [13/Feb/2012:18:03:52 +0100] "GET /~username/test/ HTTP/1.1" 500 20 "-" "Mozilla/5.0 (X11; Linux x86_64;
rv:10.0.1) Gecko/20100101 Firefox/10.0.1"so, 500 headers are returned but internal server error page is not displayed. All I get is a blank page.
So apache directive "ErrorDocument 500 /500.html" is useless in this case.
yes, but the more important is the status code so that search
engines do not index you broken page, apache SHOULD NOT provide
his own error-page because you can also send 500 status code
within your script for whatever reason and want your output
not supressed in such cases
yes, but the more important is the status code so that search
engines do not index you broken page, apache SHOULD NOT provide
his own error-page because you can also send 500 status code
within your script for whatever reason and want your output
not supressed in such cases
OK but I would like it provide it's own error page... Is it possible
somehow without patching php code and maintaining/compiling my own version?
--
Jakov Sosic
www.srce.unizg.hr
yes, but the more important is the status code so that search
engines do not index you broken page, apache SHOULD NOT provide
his own error-page because you can also send 500 status code
within your script for whatever reason and want your output
not supressed in such casesOK but I would like it provide it's own error page... Is it possible
somehow without patching php code and maintaining/compiling my own
version?
Maybe there is an easier way. This extension allows to show your own
page on PHP errors:
http://svn.wikimedia.org/viewvc/mediawiki/trunk/php/wmerrors/
Maybe there is an easier way. This extension allows to show your own
page on PHP errors:
http://svn.wikimedia.org/viewvc/mediawiki/trunk/php/wmerrors/
This:
- Don't strip symbols, deadlocks are still occurring and we need to find
out why
does not sound very promising but I will give it a try in the
development environment.
Thanks everyone for any help provided so far. Every idea is welcome.
--
Jakov Sosic
www.srce.unizg.hr