php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18447 Error-Log File is overwritten for every new Error
Submitted: 2002-07-20 04:52 UTC Modified: 2002-09-11 11:44 UTC
From: akorthaus at web dot de Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.1.2 OS: Linux
Private report: No CVE-ID: None
 [2002-07-20 04:52 UTC] akorthaus at web dot de
Hi!

I?ve run php as CGI-Version with Apache.

Because I don?t want errors to be shown on the website, I changed the following values of php.ini:

display_errors = Off
// so no Errors are displayd anymore

log_errors = On
// Errors should be logged 

error_log = log.txt
// into this file


It works fine, but there is only the last error in this log-file, old errors are overwritten.

I think error-logs should log ALL errors. If I try from SHELL:

php script.php 2>>log.txt

it works, but I can?t open all my PHP-Scripts from SHELL and I don?t want to use 2>> every time ;-)

rgds
Andreas Korthaus

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-20 12:33 UTC] sniper@php.net
I can not reproduce this with PHP 4.2.1. (CGI)
Make that filename for the log to be absolute,
e.g.:

error_log=/tmp/php-log.txt
 [2002-07-20 17:05 UTC] akorthaus at web dot de
OK, you?re right, the Problem is more difficult.

It only doesn?t work with logging Errors, if I try to start a PHP-Script form SHELL, this way:

I?ve got the following lines into my ~/.bashrc 

PATH="$PATH":"$HOME"/bin 
export PATH 

In "/bin" I?ve got my important scripts I often use, so I can start a script in "bin/file.php" from every directory only by writing "file.php". 

But - if I start a script this way, no errors are logged, if I?m in "/temp/logs" I can use "file.php", than no errors are logged, but if I write ../../bin/file.php logging works perfectly!

Do you have an idea why this happens?
 [2002-07-20 20:57 UTC] sniper@php.net
No other idea but is is the log file writable by anyone?
(And do try 4.2.1, I still can't reproduce this..)

 [2002-09-11 11:44 UTC] sniper@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 29 16:01:30 2024 UTC