A composer install normally takes a few minutes. And on a production environment it's feels too slow. Is it possible to make a composer install to a temp directory and then switch it? If that is possible the downtime should be about zero.
Or are there any other way to do a composer install faster?
Always composer update on your dev machine first, test it and if all test are valid deploy the composer. lock to your production environment and run composer install there. Now composer installes exactly the versions you tested before, even if there are newer (but untested) ones.
Go nuclear. Clear your cache, remove the vendor directory and lockfile, and do a composer update.
For this reason, it is strongly advised to avoid running Composer as super-user/root. All commands also dispatch events which can be caught by plugins so unless explicitly disabled installed plugins will be loaded/executed by every Composer command.
For updating your Composer, you need to open the terminal (if you have a global installation) and run one of the following commands: Use composer self-update --preview to try the latest RC version (2. x). Use composer self-update --snapshot to try the latest dev build (2.
I created a composer plugin to download packages in parallel.
https://packagist.org/packages/hirak/prestissimo
$ composer global require hirak/prestissimo
Please try it. In my environment, composer install
become 10 times faster.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With