Home >Development Tools >composer >How to solve the problem of slow composer usage

How to solve the problem of slow composer usage

藏色散人
藏色散人forward
2020-11-16 14:00:062690browse

The following tutorial column of composer will 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

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"
        }    }

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!

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