Categories
Tips

Composer run slowly – Make it run faster

Let’s talk about: “What’s the reasons that make composer run slowly?” and “How to make it run faster?“.

There’re 2 main reasons for this problem:

  • Download strategy is not good;
  • and Download speed is slow because of the server’s distance;

Download strategy

Thanks to hirak/prestissimo package, we can improve the download strategy to become better.

This is a composer plugin that downloads packages in parallel to speed up the installation process.

Run command to install the package:

composer global require hirak/prestissimo

Change mirror

You can found mirrors list on this page: https://packagist.org/mirrors. Choose a mirror near you and run commands to change the mirror.

Don’t worry about the command syntax. Because in each mirror page, they will provide you the command that you need to run.

Example: command for the Germany mirror will look like:

composer config -g repos.packagist composer https://packagist.hesse.im

Conclusion

Hope that article could help you solve the problem: composer run slowly. Please let me know if you have any better solutions.

Leave a Reply

Your email address will not be published.