Missing vendor/autoload.php in google-api-php-clie

2019-09-11 07:35发布

There is no folder like vendor in google-api-php-client-master, while searching for autoload.php I found it at C:\wamp\www\gapi\google-api-php-client-master\src\Google\autoload.php

On viewing the source at Google\autoload.php, its once again requesting for /vendor/autoload.php at line 21 but no folder name vendor. I have also include the full package by downloading the zip at https://github.com/google/google-api-php-client

Most of the search didn't provide me a solution, But I found lots of article on this topic. Some one help me on this.

ERROR:

Fatal error: Uncaught exception 'Exception' with message 'This library must be installed via composer or by downloading the full package. See the instructions at_ _ _' in C:\wamp\www\gapi\google-api-php-client-master\src\Google\autoload.php on line 14

FILE CONTENT (autoload.php):

$file = __DIR__ . '/../../vendor/autoload.php';

if (!file_exists($file)) {
  $exception = 'This library must be installed via composer or by downloading the full package.';
  $exception .= ' See the instructions at https://github.com/google/google-api-php-client#installation.';
  throw new **Exception($exception);

2条回答
淡お忘
2楼-- · 2019-09-11 08:07

Used composer with command " composer require google/apiclient:^2.0 " to install the package

OR

with any of the release at https://github.com/google/google-api-php-client/releases

But cant find the package vendor by directly downloading from https://github.com/google/google-api-php-client (google-api-php-client-master.zip), use any of the above two ways and be sure to have quickstart, you'll need guide at https://developers.google.com/google-apps/calendar/quickstart/php

查看更多
趁早两清
3楼-- · 2019-09-11 08:23

You need to download the folder/release from https://github.com/google/google-api-php-client/releases and not https://github.com/google/google-api-php-client.

The install guide lets you know about this here:

If you abhor using composer, you can download the package in its entirety. The Releases page lists all stable versions.

I did the same mistake, but fixed it by using the latest stable version from the release page.

查看更多
登录 后发表回答