Composer
Composer is the defacto standard to handle PHP application dependencies, as well as providing mechanisms to keep them up-2-date. Integrate Composer into your development workflow with fortrabbit.
# Get ready
It's recommended that you have a local development environment running including Composer and that you are making use of it already. Have a good understanding of deployment in general and on fortrabbit.
# Composer as part of deployment
We recommend to run composer install as part of the build pipeline. When you deploy code with Git and Composer is defined as a build step, it will run automatically with each deployment. New and updated dependencies will be synced into the web space.
# Composer and Git
The vendor folder should NOT be in Git: Make sure that folder is included in your .gitignore file. This directory is created by Composer within your project locally and contains all the packages you are using locally. Make sure that both the composer.lock file and the composer.json file are present and part of Git.
# Alternative locations
Your composer.json and composer.lock files need to be stored in the root folder of your application.
# Private repositories in Composer
You need to add the private repositories into your composer.json file? Read on here.
# Composer from SSH
While we highly recommend leveraging Composer via the Git deployment (see above), you can also execute Composer when logged in via SSH. Please note that this should only be done in certain edge cases.
ssh {{app-env-id}}@ssh.{{region}}.frbit.app composer installshell
This way Composer will be executed within the web delivery environment, which is not optimized for such tasks. Don't use composer update as this might cause Composer to hit the App's memory limits. The most common Composer issue is, when users are running into memory problems when trying to execute composer while logged in via SSH here. The general answer on that is: Please don't. Use Composer together with Git deployment as described above.
Found a tpyo?Edit