Google Api Client Php - mkdir():Permission denied

馋奶兔 提交于 2019-12-11 07:54:04

问题


Using google api client for php to fetch some data, I have encountered the following error and I can't seem to find any working solution so far.

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");
      }

I checked the permissions, users and groups. Everything is fine but I can't figure what's the problem. Any idea why this is happening?


回答1:


solved the problem by replacing $this->path with storage_path()



来源:https://stackoverflow.com/questions/27088858/google-api-client-php-mkdirpermission-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!