tobimichigan Posted December 29, 2010 Share Posted December 29, 2010 Here is my hierarchy: data -logs folder-debug.log htdocs -index.php include -Contollers,Smarty,Templater,Zend templates Now when I launch index.php from htdocs, I get this un-seeming error: "Fatal error: Uncaught exception 'Zend_Log_Exception' with message '"/var/htdocs/Books/practical_Web2.0/data/logs/debug.log" cannot be opened with mode "a"' in C:\xampp\php\PEAR\Zend\Log\Writer\Stream.php:69 Stack trace: #0 C:\xampp\htdocs\Books\practical_Web2.0\chapter-02\htdocs\index.php(11): Zend_Log_Writer_Stream->__construct('/var/htdocs/Boo...') #1 {main} thrown in C:\xampp\php\PEAR\Zend\Log\Writer\Stream.php on line 69 " I went to the zend folder in xampp, php, pear, zend, log, writer.php dir and I found this: /** * Class Constructor * * @param streamOrUrl Stream or URL to open as a stream * @param mode Mode, only applicable if a URL is given */ public function __construct($streamOrUrl, $mode = 'a') { if (is_resource($streamOrUrl)) { if (get_resource_type($streamOrUrl) != 'stream') { require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Resource is not a stream'); } if ($mode != 'a') { require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Mode cannot be changed on existing streams'); } $this->_stream = $streamOrUrl; } else { if (! $this->_stream = @fopen($streamOrUrl, $mode, false)) { require_once 'Zend/Log/Exception.php'; $msg = "\"$streamOrUrl\" cannot be opened with mode \"$mode\""; throw new Zend_Log_Exception($msg); } } $this->_formatter = new Zend_Log_Formatter_Simple(); } line 69 is =>throw new Zend_Log_Exception($msg); What could be wrong? Hint: settings.conf [development] database.type = pdo_mysql database.hostname = localhost database.username = root database.password = database.database = phpweb20 paths.base = /var/htdocs/Books/practical_Web2.0 paths.data = /var/htdocs/Books/practical_Web2.0/data paths.templates = /var/htdocs/Books/practical_Web2.0/templates logging.file = /var/htdocs/Books/practical_Web2.0/data/logs/debug.log Any pointer as to why there is a fatal error? Link to comment https://forums.phpfreaks.com/topic/222890-zend-debuglog/ Share on other sites More sharing options...
trq Posted December 29, 2010 Share Posted December 29, 2010 Your server doesn't have permissions enough to write to /var/htdocs/Books/practical_Web2.0/data/logs. Make sure it can write to this directory. Link to comment https://forums.phpfreaks.com/topic/222890-zend-debuglog/#findComment-1152513 Share on other sites More sharing options...
tobimichigan Posted December 29, 2010 Author Share Posted December 29, 2010 Pls can you indicate how I can enable my localhost to do this? Link to comment https://forums.phpfreaks.com/topic/222890-zend-debuglog/#findComment-1152521 Share on other sites More sharing options...
trq Posted December 29, 2010 Share Posted December 29, 2010 sudo chown apacheuser:apacheuser /var/htdocs/Books/practical_Web2.0/data/logs Where 'apacheuser' is the account your server runs as. Link to comment https://forums.phpfreaks.com/topic/222890-zend-debuglog/#findComment-1152524 Share on other sites More sharing options...
tobimichigan Posted December 30, 2010 Author Share Posted December 30, 2010 sudo chown apacheuser:apacheuser /var/htdocs/Books/practical_Web2.0/data/logs Where 'apacheuser' is the account your server runs as. thorpe, what exactly are u saying there? Link to comment https://forums.phpfreaks.com/topic/222890-zend-debuglog/#findComment-1152956 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.