Class Google_client not found on the server, but on localhost it's ok

1k Views Asked by At

I'm trying to use the OAuth2 php google library with the elgg engine and it's working good on localhost, but I have an error Class 'Google_client' not found... on the server, the server uses ssl protection, I don't know any other reasons why it's not working.

elgg_register_library('AOuth:gmail', $path.'/myModul/vendor/vendor/autoload.php');
elgg_load_library('AOuth:gmail');
$client = new Google_client();

Where can be problem?

1

There are 1 best solutions below

0
Romain Ortiz On

Are you sure the server use the same configuration as localhost, specially as far as PHP and Composer versions installed ?

It looks like an autoloader problem (Class not found), I had that on a couple of server where I used Google API. Google API needs PHP >= 5.3, and by default, Composer. But you can use a SPL autoloader for some configurations instead if you don't have Composer.