Composer, vendor folder, blank page

Hello. I used composer to install a couple PHP libraries I needed for my project. Composer added a vendor folder, etc. I uploaded the vendor folder and my site doesn’t render, it’s blank. If I rename the vendor folder the site loads fine. I’m just now getting my feet wet with Composer. Note: I did not install Kirby in this instance with Composer. Any insight?

Is Kirby now present in this second vendor folder as well? Then you probably have to remove Kirby from your composer.json in the root directory.

My composer.json looks like this…

{
	"require": {
		"stripe/stripe-php": "^7.67",
		"sendinblue/api-v3-sdk": "7.x.x"
	}
}

I did not use composer to install Kirby on this project. I manually installed Kirby. I then used Composer to add a couple libraries (Stripe and Sendinblue). There is no kirby folder in my vendor directory.

It’s odd. I changed the name of the vendor folder on the root and everything’s cool. Hmm.

Check the content of the composer file on the root. Does it load kirby?

No. It doesn’t. It looks exactly like the above. I removed all the other business.

Sorry, I somehow didn’t see your composer.json above.

Then I don’t know. But if you want this stuff in a plugin, you’d better add a composer json in your plugin instead of in the root folder.

Or alternatively, require all your dependencies via composer, including Kirby.

But @lukasbestle is our Composer expert, so ping!

Kirby ships with its own vendor folder when installed manually. It contains the autoloader and Kirby‘s dependencies.

Once Kirby finds another vendor folder in the root, it ignores its own one to avoid version conflicts.

So what Sonja wrote is correct: Either you install Kirby with Composer or you install the libraries within a plugin.

@texnixe, @lukasbestle, Thank you for your knowledge and insight. Very helpful.

1 Like