Re: PEAR_Log

From: Date: Thu, 16 Feb 2006 19:13:51 +0000
Subject: Re: PEAR_Log
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23014@lists.php.net to get a copy of this message
Bonsoir, Roman wrote:
hello! just installed Log package and heaving warning: ====================================================== Warning: fwrite(): supplied argument is not a valid stream resource in /usr/share/php/Log/console.php on line 193 Warning: fopen(out.log) [function.fopen]: failed to open stream: Permission denied in /usr/share/php/Log/file.php on line 228 ====================================================== caused by: ====================================================== require_once 'Log.php'; $console = &Log::factory('console', '', 'TEST'); $console->log('Logging to the console.'); $file = &Log::factory('file', 'out.log', 'TEST'); $file->log('Logging to out.log.'); ====================================================== where do i set write permissions? The user running the script must be allowed to create the file out.log, means must have read/write/excution permissions on the directory where this file is located.
Assuming you don't change working directory, this location depends on how you run the script: from console, the user running the script and: # php /some/where/test.php ==> the directory where test.php is # php -C /some/where/test.php ==> the current directory when running it from apache: apache user and the directory of the primary called script I would advice you give a file name with full path.

« previous php.pear.general (#23014) next »