From 2556c31cb103176b915b7b3e4f0046ae8591c1a9 Mon Sep 17 00:00:00 2001 From: rob Date: Mon, 29 Jun 2026 09:05:00 +0000 Subject: [PATCH] Migrated from GitLab wiki --- ...de-to-Production-and-Install-Packages.-.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 --Step-to-Push-Code-to-Production-and-Install-Packages.-.md diff --git a/--Step-to-Push-Code-to-Production-and-Install-Packages.-.md b/--Step-to-Push-Code-to-Production-and-Install-Packages.-.md new file mode 100644 index 0000000..e7667b9 --- /dev/null +++ b/--Step-to-Push-Code-to-Production-and-Install-Packages.-.md @@ -0,0 +1,32 @@ +# Composer +To update composer on production, always follow the following commands + +Download the composer version you required, in following command it is going to download 2.4.1 version. + +`wget https://getcomposer.org/download/2.4.1/composer.phar` + +Make the download file executable using following command. + +`chmod +x composer.phar` + +Move the file to the right place + +`mv composer.phar /usr/local/bin/composer` + +# Step to push code and install packages + +First, a more general note: you shouldn't be requiring individual packages on the server. That's a recipe for breaking things. You should only ever do "**composer require**" or "**composer update**" in a development environment. Composer will then figure out the right set of package versions, and record them in composer.lock. On the production server, you should only ever be running "**composer install**", which simply installs the packages/versions specified in composer.lock. + +The typical "release code to production" process should really only ever be: + +1. git pull +2. composer install +3. run any data base migrations. + +**Following are best steps to push code on live** + +1. Upgrade composer to the current version on your dev machine and on the server. +2. Get all the dependencies sorted out and working on your local machine. +3. Commit composer.json and composer.lock +4. Check out the code on the server. +5. Do "composer install" on the server.