Edit report at https://bugs.php.net/bug.php?id=65500&edit=1
ID: 65500 Updated by: yohg...@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: Analyzed Type: Bug Package: Scripting Engine problem Operating System: any PHP Version: 5.4 or later Block user comment: N Private report: N New Comment: Looked into a bit. fpm_conf.c parse config file as string and line by line. Therefore, zend ini scanner does not know filename nor line number. http://lxr.php.net/xref/PHP_TRUNK/sapi/fpm/fpm/fpm_conf.c#1502 I guess this ini scanner usage is not expected by the authors. Adding flag that allows "#" as comment will resolve this issue, but I'm not sure if this is the best resolution. Previous Comments: ------------------------------------------------------------------------ [2013-08-22 10:39:34] yohg...@php.net > If getting filename and lineno at this stage, error message could be improved. If getting filename and lineno is not feasible at this stage, error message could be improved. ------------------------------------------------------------------------ [2013-08-22 10:38:30] yohg...@php.net 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. ------------------------------------------------------------------------ [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