【发布时间】:2013-01-07 12:52:14
【问题描述】:
我面临以下错误:
无法使用模式“a”打开带有消息 file.log 的未捕获异常“Zend_Log_Exception”
在我的引导程序中,我有以下代码:
$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);
完整的错误页面:
警告: fopen(/home/http/me.tv/fbapps/www//tmp/logs/vengeance.log) [function.fopen]:打开流失败:没有这样的文件或目录 /home/http/me.tv/fbapps/www/inline/bootstrap_vengeance.php 上 第 81 行
警告:fclose() 期望参数 1 是资源,布尔值在 /home/http/me.tv/fbapps/www/inline/bootstrap_vengeance.php 上 第 82 行
致命错误:带有消息的未捕获异常“Zend_Log_Exception” '"/home/http/me.tv/fbapps/www//tmp/logs/vengeance.log" 不能 以“a”模式打开 /home/http/me.tv/fbapps/www/library/Zend/Log/Writer/Stream.php:78 堆栈跟踪:#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} 抛出 /home/http/me.tv/fbapps/www/library/Zend/Log/Writer/Stream.php 在第 78 行
【问题讨论】:
标签: php zend-framework