(I am using the latest version of this library: https://github.com/google/google-api-php-client)
In short, my script works perfectly on localhost, but whenever I upl
To debug further you can go to the API client library at /src/Google/IO/Stream.php and look for the line that is
throw new Google_IO_Exception("HTTP Error: Unable to connect");
You can append messages on to that... like this to get the http error code
throw new Google_IO_Exception("HTTP Error: Unable to connect " . $this->getHttpResponseCode($http_response_header));
Let me know if you come up with any solution, you may want to follow this issue: https://github.com/google/google-api-php-client/issues/75. My code works fine on my localhost, but not on my dev server as well but I have not figured out a solution. I got Cloud Storage working by removing the gzip CONST at the top of the Stream.php, but Drive still does not work and I am thinking this all has to be related.
EDIT: Take a look at the issue I linked, basically you should try to set gzip to disabled in the Config.php - this fixed the issues for me.
I found this issue had to do with differing PHP versions between my localhost and my server
I submitted a new issue here: https://github.com/google/google-api-php-client/issues/78