Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REPOST: php error_log not able to be set...

Status
Not open for further replies.

shadedecho

Programmer
Oct 4, 2002
336
US
I am having a problem which has persisted for the last 8 months with no solutions. I am reposting here again to see if anyone new has any new ideas.

I am running Debian 3.0 (built from source), with apache 2.0.54 (built from source) and PHP 5.0.4 (built from source).

When I leave the "error_log" item commented out in the php.ini file, and I run a script with a PHP error in it (like a call to an undefined function), the error gets dumped to my apache error log (which is virtual-host specific).

Ok... so then I think, well if in the script, i call ini_set() and set the value of the error_log directive to another file, then any subsequent errors in that executing script would be sent to THAT file, not the apache error log file, right?

Wrong... no matter what I do, it still keeps sending errors to that apache error log for that particular virtual host.

I also tried overriding the setting in the VIRTUALHOST directive in httpd.conf, like:

<VirtualHost xxx.xxx.xxx.xxx>
......
ErrorLog /path/to/apache.error
<Directory / php_value error_log "/path/to/php.error"
</Directory>
</VirtualHost>

Still, it seemed to ignore the dynamic error_log value I'm trying to give it, and in absence of one from the php.ini file, it just dumps it to the apache log file.

In addition, I am not even able to set the error_log IN PHP.INI!!! no matter what I do, errors are sent to that apache error log.

HELP! I've reported this as a bug to PHP, and they are unresponsive in helping me figure out why. They claim to be unable to reproduce it.
 
I can't reproduce your errors, either, on an FC2 Linux box with Apache 2.0.53 (built from source) and PHP 5.0.4 (built from source).

If I set error_log to '/tmp/foo.txt' in php.ini and run a script:

<?php
phpinfo();
?>

then both the local and master values are '/tmp/foo.txt'. And any error is written to that file.

If I set a value for error_log of '/tmp/bar.txt' in httpd.conf and run phpinfo(), the local value is changed to '/tmp/bar.txt' and errors are written to that file (bar.txt, not foo.txt).


If I use ini_set() to set a value '/tmp/baz.txt' for error_log in a script and run phpinfo(), the local value is changed to '/tmp/baz.txt' and errors are written to that file (baz.txt, not bar.txt).




Want the best answers? Ask the best questions!

TANSTAAFL!!
 
so what other possible external factors could be causing this? I mean, permissions aren't an issue since the apache and php error logs are in the same place... binary builds aren't an issue since i am building from source... and noone seems to be able to reproduce this problem, and yet, i promise you it is persistently occuring... across two different systems (with similar setups), i might add.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top