1

I'm trying to use the google API as long as some other API but it seems that there is no way to make it work.

I get the error message

Fatal error: Class 'Google_Service' not found in /home/msc/www/wp-content/plugins/wp-posts/lib/Google/Service/YouTube.php on line 32

The whole site is under wordpress 4,1,1

thanks in advance.

None
  • 302
  • 3
  • 20
  • 1
    You may want to turn error reporting on... – Andrei P. Feb 25 '15 at 14:27
  • 1
    Turn on error_reporting and see which errors you have, perhaps you don't have the last file in that directory or with that name. – lmarcelocc Feb 25 '15 at 14:27
  • Fatal error: Class 'Google_Service' not found in /home/msc/www/wp-content/plugins/wp-posts/lib/Google/Service/YouTube.php on line 32 – None Feb 25 '15 at 14:31

2 Answers2

7

The answer was simple enough

I added

require_once 'Google/autoload.php';

based on this topic :

Link here

Community
  • 1
  • 1
None
  • 302
  • 3
  • 20
  • 1
    I get the same error above, but, to make this tricky, in the github repo I downloaded I cannot find Google/autoload.php - ref: https://github.com/google/google-api-php-client - any idea how to find that file or fix? thanks – Wonko the Sane Oct 30 '15 at 02:55
0

You need to set an include path that points to where the /Google folder is

set_include_path('C:/path/to');
NickStees
  • 449
  • 4
  • 12