问题
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