Home  >  Article  >  Development Tools  >  The ultimate solution: Solve the problem of Composer installation being too slow

The ultimate solution: Solve the problem of Composer installation being too slow

藏色散人
藏色散人forward
2020-06-16 13:46:453852browse

The following tutorial column of composer will introduce to you the method to solve the problem of Composer installation being too slow. I hope it will be helpful to friends in need!

The ultimate solution: Solve the problem of Composer installation being too slow

Essential tools: ssr

Many people encounter very slow speeds when using composer to download packages, and basically cannot Regarding the usage problem, most of the solutions on the Internet suggest changing the Chinese image, but it is still very difficult to use.

1. Set composer to the original mirror addresscomposer config -g repo.packagist composer https://packagist.phpcomposer.com

2. Configure ssr LAN proxy

ssr > Option Settings > Check 'Allow connections from LAN' under Local Agent

Option Settings> Local Port>1088

In order to ensure If the configuration is successful, it is recommended to change the port number to port 1088 as an example

3. Configure the proxy in the cmd command line

set http_proxy=http://127.0.0.1:1088
set https_proxy=http://127.0.0.1:1088

4. Use cmd curl to test whether the configuration is successful

Be careful not to use ping without curl. Go to the official website to download and decompress

Because ping does not use the tcp protocol, the proxy does not take effect

curl https://www.youtube.com

If there is a return, the configuration is successful

5. Now execute composer install and enjoy the speed~

For more composer technical articles, please visit the composer column!

The above is the detailed content of The ultimate solution: Solve the problem of Composer installation being too slow. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete