How to solve the problem of slow composer usage

藏色散人
Release: 2020-11-16 14:00:06
forward
2564 people have browsed it

The following tutorial column ofcomposerwill introduce to you the solution to the problem of slow composer usage. I hope it will be helpful to friends in need!

How to solve the problem of slow composer usage

Let’s briefly talk about the difference between composer update and composer install: Here is the mechanism of composer. When the `composer.lock` file exists, when the `composer install` command is executed , composer will update and install according to the specified version of the package in `composer.lock`. If `composer update` is executed, the `package` version will be updated, and the `composer.lock` file will be updated (I don’t understand the difference, Refer to Zhihu).

The recommended acceleration method in composer China is to replace the default foreign image with a domestic one.

Specific steps:

composer config repo.packagist composer https://packagist.phpcomposer.com
Copy after login

This command is to modify the config.json configuration

Then add the following to the composer.json file in your project:

"repositories": { "packagist": { "type": "composer", "url": "https://packagist.phpcomposer.com" } }
Copy after login

After the test, the speed has become much faster.

The above is the detailed content of How to solve the problem of slow composer usage. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!