parse errors no longer visible

php.internals

Derick Rethans

23 years ago
Hello, I was trying to make a screenshot of a parse error today, but found out that I was unable to get it shown on the screen. Error reporting was set to 2047 in php.ini, but still nothing to see (only in my apache error log). So I tracked the calls into php_error_cb, and see here the results: (gdb) run -X Starting program: /dat/dev/php/apache_1.3.27/src/httpd -X Program received signal SIGINT, Interrupt. 0x407c15be in __select () at __select:-1 -1 __select: No such file or directory. in __select (gdb) bre php_error_cb Breakpoint 1 at 0x80aefce: file /dat/dev/php/php-5.0.0dev/main/main.c, line 584.(gdb) cont Continuing. Breakpoint 1, php_error_cb (type=4, error_filename=0x841ae84 "/home/httpd/html/test/xdebug_error.php", error_lineno=3, format=0x84d1710 "parse error", args=0xbfffbbe8) at /dat/dev/php/php-5.0.0dev/main/main.c:584 warning: Source file is more recent than executable. 584 buffer_len = vspprintf(&buffer, PG(log_errors_max_len), format, args); (gdb) next 585 if (PG(ignore_repeated_errors)) { (gdb) next 595 display = 1; (gdb) next 597 strlcpy(last_error.buf, buffer, sizeof(last_error.buf)); (gdb) next 598 strlcpy(last_error.filename, error_filename, sizeof(last_error.filename)); (gdb) next 599 last_error.lineno = error_lineno; (gdb) next 602 if (display && (EG(error_reporting) & type || (type & E_CORE)) (gdb) print executor_globals.error_reporting $1 = 0 As you see the error_reporting level is '0' here, and thus nothing is shown. I couldn't find why it is '0' here, but I suspect that the following patch might be the problem: http://news.php.net/article.php?group=php.zend-engine.cvs&article=638 Derick
-- ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ JDI Media Solutions http://www.jdimedia.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

Zeev Suraski

23 years ago
I have no problem getting a parse error to be shown, can you describe what you did to get that behavior? Zeev At 16:53 23/04/2003, Derick Rethans wrote:

Derick Rethans

23 years ago
On Wed, 23 Apr 2003, Zeev Suraski wrote:
> I have no problem getting a parse error to be shown, can you describe what > you did to get that behavior?
Oh, that's easy: 1. Use this script (yes, it has parse errors :): <?php $this->fix_string($item); } } } $s = new strings(); $ret = $s->fix_strings(array('Derick')); ?> 2. Use no php.ini: and request the page... you'll see no error. Derick
-- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

Marshall A. Greenblatt

23 years ago
Hi Derick, ----- Original Message ----- From: "Derick Rethans" <derick@php.net> To: "Zeev Suraski" <zeev@zend.com> Cc: "PHP Developers Mailing List" <internals@lists.php.net> Sent: Thursday, April 24, 2003 4:03 AM Subject: Re: [PHP-DEV] parse errors no longer visible
> On Wed, 23 Apr 2003, Zeev Suraski wrote: > > > I have no problem getting a parse error to be shown, can you describe
what
> > you did to get that behavior? > > Oh, that's easy:
[snip]
> 2. Use no php.ini: > > and request the page... you'll see no error.
In your first email you mention that you had modified the error_reporting value in php.ini. In this email you said that no php.ini was used. However, there is one more value that you'll want to check: ; - display_errors = Off [Security] ; With this directive set to off, errors that occur during the execution of ; scripts will no longer be displayed as a part of the script output, and thus, ; will no longer be exposed to remote users. With some errors, the error message ; content may expose information about your script, web server, or database ; server that may be exploitable for hacking. Production sites should have this ; directive set to off.
> > Derick
Hope that helps! - Marshall

Derick Rethans

23 years ago
On Thu, 24 Apr 2003, Marshall A. Greenblatt wrote:
> In your first email you mention that you had modified the error_reporting > value in php.ini. In this email you said that no php.ini was used. > However, there is one more value that you'll want to check:
I know of these options, with it on or off... it doesnt matter. I just explained the easiest way to reproduce it. Derick
-- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

Derick Rethans

23 years ago
On Wed, 23 Apr 2003, Zeev Suraski wrote:
> I have no problem getting a parse error to be shown, can you describe what > you did to get that behavior?
Never mind this... user problem ;-) Derick
-- "my other box is your windows PC" ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------