2012-08-27 158 views
0

我正在尝试修复损坏的Webstore。我收到以下错误消息。file_put_contents - 警告消息

警告: file_put_contents(/hermes/web06/XXXX/XXXXX/webstore/includes/work/configuration.cache) [function.file-把-内容]:未能打开流:没有这样的文件或在那里,在所述位置上所示 目录中 /hermes/waloraweb053/XXXX/XXXXX/webstore/includes/classes/cache.php上 线52

的configuration.cache和cache.php路径。

configuration.cache没有52行(只有3行很长),但是cache.php没有。

这是我认为与这种情况有关的代码。

/** 
* Write the data to a cache file 
* 
* @param string mixed $data The data to cache 
* @param string $key The key ID to save the cached data with 
* @access public 
*/ 

    public function write($data, $key = null) { 
     if (empty($key)) { 
     $key = $this->_key; 
     } 

     return (file_put_contents(DIR_FS_WORK . $key . '.cache', serialize($data), LOCK_EX) !== false); 
    } 

注意:第52行是return (file_put_contents(DIR_FS_WORK . $key . '.cache', serialize($data), LOCK_EX) !== false);一行。

任何帮助或建议最受欢迎!

感谢

+1

听起来像是权限问题。确保web服务器守护程序运行时,configuration.cache可由用户写入。 '编辑'Hrmm,不取消 - 它会说“权限被拒绝”而不是“没有这样的文件” –

回答

0

只有我注意到的事情是,你的代码和你的缓存文件在不同的树木。这是故意的吗?即,你试图写入到缓存:

/hermes/web06/ 

但你的代码是:

/hermes/waloraweb053/ 

如果这些是一样的吗?也许当你认为你正在查看是否存在/hermes/web06/XXXX/XXXXX/webstore/includes/work/configuration.cache时,你实际上正在查看/hermes/waloraweb053/XXXX/XXXXX/webstore/includes/work/configuration.cache