Bug #65500 [Opn->Ana]: debug_backtrace doesn't identify file name when config contains invalid comment
| From: | yohgaki@php.net | Date: | Thu, 22 Aug 2013 10:38:30 +0000 |
| Subject: | Bug #65500 [Opn->Ana]: debug_backtrace doesn't identify file name when config contains invalid comment | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-181117@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65500&edit=1
ID: 65500
Updated by: yohgaki@php.net
Reported by: alina dot sch61 at gmail dot com
Summary: debug_backtrace doesn't identify file name when
config contains invalid comment
-Status: Open
+Status: Analyzed
Type: Bug
-Package: FPM related
+Package: Scripting Engine problem
-Operating System: Linux
+Operating System: any
-PHP Version: 5.4.18
+PHP Version: 5.4 or later
Block user comment: N
Private report: N
New Comment:
Ini settings are scanned by zend_ini_scanner.c
http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_ini_scanner.l#592
zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on
line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
If getting filename and lineno at this stage, error message could be improved.
"Comments starting with '#' in php config file are deprecated" or like.
Previous Comments:
------------------------------------------------------------------------
[2013-08-22 08:30:35] alina dot sch61 at gmail dot com
Description:
------------
If php-fpm.conf contains not correctly commented string (commented with "#"
symbol instead of semicolon), debug_backtrace() function
doesn't return in message name of file and line where this mistake was done:
[args] => Array(
[0] => ErrorException Object(
[message:protected] => Comments starting with '#' are deprecated in Unknown
on line 1
[string:Exception:private] =>
[code:protected] => 8192
[file:protected] => Unknown
[line:protected] => 0
[trace:Exception:private] => Array(
[0] => Array(
[function] => shutdownHandler
[class] => Shared\Error\ErrorHandler
[type] => ->
[args] => Array()
)
)
[previous:Exception:private] =>
[severity:protected] => 0
)
)
But if such comment is made in config of one of the extensions (e.g. mysql.ini)
name of file will be successfully identified for message.
[args] => Array(
[0] => ErrorException Object(
[message:protected] => Comments starting with '#' are deprecated in
/etc/php5/fpm/conf.d/20-mysql.ini on line 2
[string:Exception:private] =>
[code:protected] => 8192
[file:protected] => Unknown
[line:protected] => 0
[trace:Exception:private] => Array(
[0] => Array(
[function] => shutdownHandler
[class] => Shared\Error\ErrorHandler
[type] => ->
[args] => Array()
)
)
[previous:Exception:private] =>
[severity:protected] => 0
)
)
Expected result:
----------------
If not correct comment is in php-fpm.conf message doesn't contain file name:
[message:protected] => Comments starting with '#' are deprecated in
/etc/php5/fpm/php-fpm.conf on line 7
Actual result:
--------------
If not correct comment is in php-fpm.conf message doesn't contain file name:
[message:protected] => Comments starting with '#' are deprecated in Unknown on
line 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65500&edit=1