我是Zend的新手,我使用WampServer,我想要一个保存日志的文件夹,
我修改了httpd.config如下:
<VirtualHost *:80>
ServerName phpweb20
DocumentRoot C:\wamp\www\phpweb20\htdocs
SetEnv APPLICATION_ENV "development"
<Directory C:\wamp\www\phpweb20\htdocs>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>我被添加到C:\windows\ was 32\驱动程序等主机。
此外,我还在系统变量中添加了路径。
这是我的文件目录:

首先,在我的setting.ini中,在开发中插入了logging.file:
[development]
database.type = pdo_mysql
database.hostname = localhost
database.username = phpweb20
database.password = myPassword
database.database = phpweb20
paths.base = /../phpweb20
paths.data = /../data
paths.templates = /../phpweb20/templates
logging.file = /../data/logs/debug.log另外,我被添加到我的index.php中。
$writer = new Zend_Log_Writer_Stream('../data/logs');
$logger = new Zend_Log($writer);
$logger = new Zend_Log(new Zend_Log_Writer_Stream($config->logging->file));
Zend_Registry::set('logger', $logger);但是出现了错误:致命错误:带有消息‘../数据/日志’的未明异常'Zend_Log_Exception‘不能用模式“a”打开,我如何修复它?
发布于 2014-11-29 12:52:54
尝试从以下位置更改您的路径:
logging.file = /../data/logs/debug.log至:
logging.file = APPLICATION_PATH "/../data/logs/debug.log"不要忘记数据/日志目录的适当权限。
此外,$writer在您的代码中是不必要的,因为您正在用内联创建的编写器覆盖$logger。
然后移除:
$writer = new Zend_Log_Writer_Stream('../data/logs');
$logger = new Zend_Log($writer);从你的密码里。
https://stackoverflow.com/questions/27202368
复制相似问题