php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48749 enabling error_log directive crashes PHP
Submitted: 2009-06-30 21:28 UTC Modified: 2009-06-30 22:37 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: karel dot horsky at centrum dot cz Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.2.10 OS: Windows XP Pro
Private report: No CVE-ID: None
 [2009-06-30 21:28 UTC] karel dot horsky at centrum dot cz
Description:
------------
When I set error_log directive (I tried to set it via php.ini or ini_set function), PHP randomly crashes.

What can I reproduce every time is that the result of phpinfo(). Behaves differently in different browsers:
- no resut page in IE ("Can't display page")
- Firefox starts with phpinfo result, than "The connection was reset"
- Opera stops at Apache Environment section)

After couple of refreshes (same behavior) Apache and PHP crashes, I get no response at all.

Without phpinfo, PHP randomly crashes after couple of requests.

It's fresh installation of OS, all patches, than only Apache 2.2.11, MySQL 5.1.35, PHP 5.2.10 and Zend Studio 6.1.2.

I could submit whole php.ini, but I used php.ini-recommended when I was looking for error.

Reproduce code:
---------------
<?php
	ini_set('error_log','D:\\PHP\\php_error.log');
	phpinfo();
?>

or set directive in php.ini

Expected result:
----------------
Whole result of phpinfo, no crashes when error_log file is used.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-30 21:33 UTC] pajoye@php.net
Any zend extension loaded?
 [2009-06-30 21:42 UTC] karel dot horsky at centrum dot cz
I found that error_log directive works fine until directive error_reporting is set to "E_ALL | E_STRICT". Than it behaves as described.
 [2009-06-30 21:44 UTC] karel dot horsky at centrum dot cz
I tried it with and withou ZendDebugger. Same result.

Extension list taken from php.ini:
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
;extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
extension=php_sqlite.dll
;extension=php_sybase_ct.dll
extension=php_tidy.dll
;extension=php_xmlrpc.dll
extension=php_xsl.dll
extension=php_zip.dll
 [2009-06-30 21:59 UTC] pajoye@php.net
Ah, it does not crash but your script has certainly some warnings or notices breaking your script.

Enable the log and read them, it will show what's wrong
 [2009-06-30 22:16 UTC] karel dot horsky at centrum dot cz
Well, the script is calling only phpinfo(). So I wouldn't be so certain about errors or notices inside the script.

When I turn off E_STRICT, there is nothing in the error log. No error, no notices. When I turn it on, I couldn't finish the script, so I couldn't report content of my error_log - file is created, but no messages.

Magic circle...
 [2009-06-30 22:22 UTC] karel dot horsky at centrum dot cz
I turned E_STRICT on and tried to report to syslog. This error I've already seen reported. But it doesn't explain why there is nothing in error log and why php crashes. I've got same php.ini before (E_ALL | E_STRICT enabled with error_log file) and it worked as expected.

Message from syslog:
PHP Strict Standards:  phpinfo() [<a href='function.phpinfo'>function.phpinfo</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in D:\Apache\htdocs\example.php on line 2.
 [2009-06-30 22:34 UTC] pajoye@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2009-06-30 22:35 UTC] karel dot horsky at centrum dot cz
After setting correct timzeone to php.ini, everything works fine. That solved my problem.

My opinion is that php still behaves incorrectly when crashes without a message in this situation:
- error_log = <filename>
- error_reporting E_ALL | E_STRICT
- timezone not set
 [2009-06-30 22:37 UTC] pajoye@php.net
Ok, due to the infinite loop in this case. We have another bug report about that. Thanks for your feedback!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 13:01:30 2024 UTC