2014-11-23 95 views
1

使用谷歌API客户端为PHP获取一些数据,我也遇到过下面的错误,我似乎无法找到任何有效的解决方案为止。谷歌API客户端的PHP - MKDIR():权限被拒绝

mkdir(): Permission denied 
$storageDir = $this->path . '/' . substr(md5($file), 0, 2); 
    if ($forWrite && ! is_dir($storageDir)) { 
     if (! mkdir($storageDir, 0755, true)) { 
     throw new Google_Cache_Exception("Could not create storage directory: $storageDir"); 
     } 

我检查了权限,用户和组。一切都很好,但我不知道有什么问题。 任何想法为什么发生这种情况?

回答

1

通过将$this->path替换为storage_path()

解决了该问题