Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor autoload.php doesn't exist? #638

Closed
alvarotrigo opened this issue Jul 5, 2018 · 11 comments
Closed

Vendor autoload.php doesn't exist? #638

alvarotrigo opened this issue Jul 5, 2018 · 11 comments
Labels
status: duplicate duplicate issue

Comments

@alvarotrigo
Copy link

alvarotrigo commented Jul 5, 2018

I'm getting the following error:

Warning: require(/xxxxxxxx/sendgrid/vendor/autoload.php): failed to open stream: No such file or directory in /xxxxxxxx/sendgrid/sendgrid-php.php on line 14

I found these related issues but there's no proper solution offered there: #407

Why is this vendor not file not included in github??
The PHP example you guys provide doesn't even work this way.

@alvarotrigo alvarotrigo changed the title Vendor autoload doesn't exist? Vendor autoload.php doesn't exist? Jul 5, 2018
@martijnmelchers
Copy link
Contributor

martijnmelchers commented Jul 5, 2018 via email

@alvarotrigo
Copy link
Author

No. The docs say using composer is optional. I'm not familiar with composer and I would rather not use it if I can.
What it doesn't specify is where to get the file when not using composer.

@martijnmelchers
Copy link
Contributor

martijnmelchers commented Jul 5, 2018

Although using composer is not required I do really recommend it. It makes updating so much easier and its super easy to use.

But here goes:

If you dont want use composer you need to download the project as .zip and extract it and add:

require directory/sendgrid-php/loader.php

@alvarotrigo
Copy link
Author

and add:
require directory/sendgrid-php/loader.php

Add that where?

@alvarotrigo
Copy link
Author

Also, there's no such file "loader.php" in the root folder of sendgrid-php.
Are you talking about the one within the lib folder? lib/loader.php ?

@alvarotrigo
Copy link
Author

alvarotrigo commented Jul 5, 2018

Even when replacing:

require("./sendgrid/sendgrid-php.php");

For

require("./sendgrid/lib/loader.php");

I get the following error:

Warning: require_once(/xxx/sendgrid/lib/mail/BatchId): failed to open stream: No such file or directory in /xxx/sendgrid/lib/loader.php on line 19

@alvarotrigo
Copy link
Author

I had to end up using composer...

@thinkingserious
Copy link
Contributor

Hi @alvarotrigo,

My apologies, you received that last error because of this bug.

I'm glad you were able to get things going with Composer, it's an excellent tool.

With Best Regards,

Elmer

Thanks for helping out @martijnmelchers!

@alvarotrigo
Copy link
Author

Thanks for the info!

@pleckie
Copy link

pleckie commented Jan 20, 2020

This bug is still here in Jan 2020.

Update the documentation on https://sendgrid.com/docs/for-developers/sending-email/v3-php-code-example/

It isn't helpful to the product to have stale documentation, and then just say 'Use composer' when it it Literally in the documentation.

@EvaLok
Copy link

EvaLok commented Oct 22, 2020

@alvarotrigo @pleckie i made a PR that allows for standalone usage (still requires the php-http-client dependency, of course), not sure if they'll use it but may be useful for you :)

#1011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate duplicate issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants