How to deploy a composer based installation?

Which folders and files do I have to upload to my webhost when using a composer based concrete installation?

I used this composer based skeleton and uploaded

  • public (folder)
  • vendor (folder)
  • .env
  • composer.json
  • composer.lock

The domain points to the public folder.

Database settings are set in .env file.

Checked file/folder permissions. They are set to 755.

But I get a HTTP 500 error.

I see, all of you guys like the HTTP 500 error. The same as I do :rofl:

Another lesson learned, for me at least. I figured it out, today. The http error 500 could be everything. Everything. The http error log didn’t show up anything useful. So you have to turn on php error logging on the host. And there I discovered that I accidentally deleted the ‘src’ folder from the composer skeleton. And the the composer autoloader didn’t find the helper.php within src.

And when deploying the whole installation to the host you have to deploy:

  • public (folder)
  • src (folder)
  • vendor (folder)
  • .env
  • composer.json
  • composer.lock
1 Like

It’s always appreciated to see someone follow up on their own question! Just to add to this - you also could remove the autoload section in your composer.json which references the ./src directory if you aren’t using it for your project

2 Likes