ID:               30668
 User updated by:  kauschovar at sdk dot ath dot cx
 Reported By:      kauschovar at sdk dot ath dot cx
-Status:           Bogus
+Status:           Open
 Bug Type:         *General Issues
 Operating System: Linux
 PHP Version:      4.3.9
 New Comment:

You're right about ini_get().  But the fact is that PHP is still
logging to the wrong log file.  Furthermore, it's inconsistent between
Apache 1 and Apache 2.  It doesn't work *at all* with Apache 1 (the
version of Apache recommended by the PHP team).


Previous Comments:
------------------------------------------------------------------------

[2004-11-04 08:49:12] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Use ini_get() instead of get_cfg_var() as the latter always returns
values from php.ini and will not show values altered  with ini_set().

------------------------------------------------------------------------

[2004-11-03 00:47:51] kauschovar at sdk dot ath dot cx

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 this bug report at http://bugs.php.net/?id=30668&edit=1

Reply via email to