Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tovisbratsburg's avatar

Workflow

Do people generally set up composer on the production server or where you do all of your work on a local server or both? I've been setting it up on the production server and pulling it down, but maybe its a better idea to put it on the local and push it up.

0 likes
3 replies
Snapey's avatar

composer ideally needs to be on both.

At any time, you should be able to rebuild the vendor folder using your composer.json file to state all the php packages required.

In development, after you run composer install, a composer.lock file is created that contains all the specific version of every package and their dependencies. This composer.lock file and the composer.json files are committed to your source code repository.

Then on production, you can clone the repo and run composer install. This will find your composer.lock file and pull down all the exact package versions as you used in development.

bestmomo's avatar

In complement take care to have the same PHP version on both sides and maybe Composer version.

Please or to participate in this conversation.