Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A client error occurred: Could not create storage directory: /tmp/Google_Client/00

What does this error mean with the Youtube API v3.0:

A client error occurred: Could not create storage directory: /tmp/Google_Client/00

I am using the PHP Youtube API on Google's documentation found here.

like image 656
Someone Avatar asked Dec 01 '22 19:12

Someone


2 Answers

I solved this problem without changing any line of Google API. In your php code, you juste need to specify where you want the cache folder to be:

$config = new Google_Config();
$config->setClassConfig('Google_Cache_File', array('directory' => '../tmp/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);
// And then,  you pass the config for your GoogleClient

It works fine for me using the Google Calendar Service.

like image 125
WebEtAlors.fr Avatar answered Dec 10 '22 21:12

WebEtAlors.fr


I was having a similar issue. I am on a shared hosting.

I was working on youtube api which was asking me to create Google_Client folder under the main \tmp on the server. Due to restriction that was not happening so I went into the

google-api-php-client/src/conifg.php and changed the following line.

    /***********************************Shared server therefore cannot write to server's /tmp drive therefore using an alternate location*************************************************/
    //'ioFileCache_directory'  => (function_exists('sys_get_temp_dir') ? sys_get_temp_dir().'/Google_Client' : '/tmp/Google_Client'),
    'ioFileCache_directory'  => 'tmp/Google_Client',

Then I created a tmp directory under google-api-php-client/src

Then I created a Google_Client directory under google-api-php-client/src/tmp

This worked for me. Hope this helps. If yes then mark it as answer as many folks are having the same problem.

like image 29
Talha Avatar answered Dec 10 '22 22:12

Talha