Home Ask Login Register

Developers Planet

Your answer is one click away!

deanresin February 2016

How can I install Google API client library on server for php without Shell (SSH) access?

I'm with HostPapa and they don't allow Shell access, only FTP. How can I install Google's API client library on my server? I'm a noob with git as well. I was trying to follow this guide...

https://developers.google.com/api-client-library/php/start/installation

but I either need Composer or Shell access. Is there another way? Thanks so much.

edit: trying something. I uploaded the library to my working directory.

set_include_path(get_include_path() . PATH_SEPARATOR . '/google-api-php-client-1.1.7/src');
require 'Google/autoload.php';
require 'Google/Client.php';
// my code...

when I try to run my php script I get

<b>Warning</b>:  require(Google/autoload.php): failed to open stream: No such file or directory in <b>/path/to/my/script.php</b> on line <b>37</b><br />
   <br />
   <b>Warning</b>:  require(Google/autoload.php): failed to open stream: No such file or directory in <b>/path/to/my/script.php</b> on line <b>37</b><br />
   <br />
   <b>Fatal error</b>:  require(): Failed opening required 'Google/autoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/google-api-php-client-1.1.7/src') in <b>/path/to/my/script.php</b> on line <b>37</b><br />

edit: K, I messed up.. should be...

set_include_path(get_include_path() . PATH_SEPARATOR . 'google-api-php-client-1.1.7/src');
require 'Google/autoload.php';
require 'Google/Client.php';
// my code...

I had to take out the '/' at the beginning of my relative path.

Answers


Luton Datta February 2016

  1. Download the released version from: https://github.com/google/google-api-php-client/releases
  2. Set include path: set_include_path(get_include_path() . PATH_SEPARATOR . 'your/path/to/src');
  3. Now include autoloader file: require 'Google/autoload.php';
  4. Your tasks: require 'Google/Client.php'; // your stuff

Post Status

Asked in February 2016
Viewed 2,447 times
Voted 9
Answered 1 times

Search




Leave an answer


Quote of the day: live life