Mkdir error. Access is denied. google api

I am trying to use a service account in the Google API to add a calendar event using php. I am already working great on the site. When I moved it to another site on the same server, I suddenly started receiving the following error messages:

~ PHP Warning: mkdir (): permission denied in Google / Cache / File.php

~ Failed to throw "Google_Cache_Exception" with the message "Could not create storage directory: in Google / Cache / File.php

Both environments are the same, as far as I can tell ~ The same server ~ The same permissions for all files / folders ~ The same credentials ~ Both URLs are authorized in the Google console.

I checked on my server to find out if there could be something in the answer back here , but was sure that everything was configured correctly.

I searched and read a lot, but I can’t imagine what could cause these errors when everything works fine with another site.

Any help would be greatly appreciated!

+4
source share
3 answers

In case someone comes to this: I solved this by following the tips here: A client error occurred: Failed to create storage directory: / tmp / Google_Client / 00

, (google cache) tmp, Google ( ):

$config = new Google_Config();
$config->setClassConfig('Google_Cache_File', array('directory' => '../../tmp/google/cache'));
// Here I set a relative folder to avoid pb on permissions to a folder like /tmp that is not permitted on my mutualised host

$client = new Google_Client($config);
+1

PHP script:

$client = new Google_Client();
$client->setCache(new Google_Cache_File('/path/to/shared/cache'));
+1

, - . Codeigniter osx el capitan mac Windows 7. Google , , : mkdir , google/cache/file.php

, google api >

$config = new Google_Config();
$config->setClassConfig('Google_Cache_File', array('directory' => 'application/third_party/Google/src/Google/Cache/'));
$client = new Google_Client($config);

, .

, , .

+1

Source: https://habr.com/ru/post/1613683/


All Articles