Google Api客户端PHP-mkdir():权限被拒绝 [英] Google Api Client Php - mkdir():Permission denied

查看:86
本文介绍了Google Api客户端PHP-mkdir():权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用php的google api客户端获取某些数据,我遇到了以下错误,到目前为止,我似乎找不到任何有效的解决方案.

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?

推荐答案

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

这篇关于Google Api客户端PHP-mkdir():权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆