sto affrontando il seguente errore:eccezione Uncaught 'Zend_Log_Exception' con il messaggio file.log non può essere aperto con la modalità "a"
Uncaught exception 'Zend_Log_Exception' with message file.log cannot be opened with mode "a"
Nel mio bootstrap ho il seguente codice:
$logfile = PROJECT_PATH . DIRECTORY_SEPARATOR .'/tmp/logs/'.$config->app->logfile.'.log';
if (!file_exists($logfile))
{
$fp = fopen($logfile, 'a');
fclose($fp);
}
$redacteur = new Zend_Log_Writer_Stream($logfile);
$logger = new Zend_Log($redacteur);
la pagina di errore completo:
Warning: fopen(/home/http/me.tv/fbapps/www//tmp/logs/vengeance.log) [function.fopen]: failed to open stream: No such file or directory in /home/http/me.tv/fbapps/www/inline/bootstrap_vengeance.php on line 81
Warning: fclose() expects parameter 1 to be resource, boolean given in /home/http/me.tv/fbapps/www/inline/bootstrap_vengeance.php on line 82
Fatal error: Uncaught exception 'Zend_Log_Exception' with message '"/home/http/me.tv/fbapps/www//tmp/logs/vengeance.log" cannot be opened with mode "a"' in /home/http/me.tv/fbapps/www/library/Zend/Log/Writer/Stream.php:78 Stack trace: #0 /home/http/me.tv/fbapps/www/inline/bootstrap_vengeance.php(85): Zend_Log_Writer_Stream->__construct('/home/http/medi...') #1 /home/http/me.tv/fbapps/www/htdocs/vengeance/index.php(9): require_once('/home/http/medi...') #2 {main} thrown in /home/http/me.tv/fbapps/www/library/Zend/Log/Writer/Stream.php on line 78
thx per il vostro aiuto – Slrg
Avevo le autorizzazioni '755' sull'intera directory e il file non esisteva. La modifica delle autorizzazioni nella directory su "777" ha risolto il problema. – Radek
Ho messo chmod 777 sia sul file che sulla directory .. PHPUnit è sitll che mi dà lo stesso messaggio di errore. 'non può essere aperto in modalità" a "' – Erik