#30668 [NEW]: error_log ini inconsistent
| From: | kauschovar at sdk dot ath dot cx | Date: | Tue, 02 Nov 2004 23:47:55 +0000 |
| Subject: | #30668 [NEW]: error_log ini inconsistent | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-68643@lists.php.net to get a copy of this message | ||
From: kauschovar at sdk dot ath dot cx
Operating system: Linux
PHP version: 4.3.9
PHP Bug Type: *General Issues
Bug description: error_log ini inconsistent
Description:
------------
The php.ini setting 'error_log' doesn't seem to behave according to its
description in the manual: http://www.php.net/manual/en/ref.errorfunc.php.
It also does not behave consistently between Apache 1.3 and Apache 2.
In both versions of Apache, 'error_log' can not be overridden in
httpd.conf, .htaccess, or by ini_set(). The example script below
demonstrates that. Only changes made to php.ini seem to be recognized.
This contradicts the manual, which says that 'error_log' has a changeable
property of PHP_INI_ALL, meaning that it can be changed in any of the
places I mentioned above.
In Apache 2, if 'error_log' is set in php.ini then it will log to the
appropriate file, but it will still not recognize changes made in any
other fashion.
In Apache 1.3, PHP will always log to Apache's error_log
(/var/log/apache/error_log on my system) regardless of what 'error_log' is
set to. Considering the stern warning against using Apache 2
(http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2),
I think making 'error_log' work with Apache 1 is important.
Of course, 'log_errors' is enabled during all of this, I restarted Apache
every time I changed a setting in php.ini, httpd.conf or .htaccess, and I
made sure that the specified log file was writable by apache (indeed it
successfully wrote to it when testing Apache 2, so I know that permissions
are okay).
I tested this on two different machines with both Apache 1 and Apache 2,
but both machines are running Gentoo Linux. I don't have a machine with
a different Operating system to confirm this bug with.
Reproduce code:
---------------
<?php
echo '<pre>';
ini_set('error_log', 'php_error_log');
var_dump(get_cfg_var('error_log'));
echo '</pre>';
// 404.html doesn't exist. This will trigger an error which is
// supposed to be logged to the file set by 'error_log'
require_once '404.html';
?>
Expected result:
----------------
Excepted to see a warning about PHP failing to open 404.html in my log
file set by 'error_log'. Also, expected to be able to override the value
set by php.ini in httpd.conf, .htaccess, or by ini_set().
Actual result:
--------------
From the var_dump():
string(39) "/var/www/localhost/htdocs/phperrors.log"
... which is the value I set in my php.ini.
Additionally (with Apache 1.3), I expected to see "Warning:
main(404.html): failed to open stream" and "Fatal error: main(): Failed
opening required '404.html'" in phperrors.log, but instead they appeared
in Apache's error_log.
--
Edit bug report at http://bugs.php.net/?id=30668&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30668&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30668&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30668&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30668&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30668&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30668&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30668&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30668&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30668&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30668&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30668&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30668&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30668&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30668&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30668&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30668&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30668&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30668&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30668&r=mysqlcfg