Composer Update is unsuccessful, enable configuration changes for domestic mirror sites

Source: Internet
Author: User
Usage:

There are two ways to enable this mirroring service:

    1. Add the following configuration information to the Composer configuration file Config.json (System global Configuration). See "Example 1"
    2. Add the following configuration information to your project's Composer.json file (configured for a single project). See "Example 2"
in order to avoid the installation of the package two times to execute the query, remember to add the disabled packagist settings, as follows:
        {"            repositories": [                {"type": "Composer", "url": "http://pkg.phpcomposer.com/repo/packagist/"},                {" Packagist ": false}            "        }        

Example 1, modifying the composer configuration file

View Composer Home directory: composer config -l -g commands allow you to list composer global configuration information in which the [home] configuration entry is the home directory of composer. Linux users please execute the sudo composer config -l -g command.

Enter the composer home directory, open the Config.json file (if you do not create one yourself), and then increase the configuration information for this image service, the final content is as follows:

        {            "config": {            },            "repositories": [                {"type": "Composer", "url": "http://pkg.phpcomposer.com/repo/ packagist/"},                {" Packagist ": false}            ]        }        

Example 2, with the Laravel project's Composer.json configuration file as an example, add this image service configuration information as follows (note the last few lines):

        {"Name": "Laravel/laravel", "description": "The Laravel Framework.", "keywords":                ["Framework", "Laravel"], "license": "MIT", "type": "Project", "require": { "Laravel/framework": "4.2.*"}, "AutoLoad": {"Classmap": ["AP P/commands "," App/controllers "," App/models "," App/database/migra tions "," app/database/seeds "," app/tests/testcase.php "]}                    , "scripts": {"Post-install-cmd": ["PHP Artisan clear-compiled", "PHP artisan Optimize"], "post-update-cmd": ["PHP artisan Clea                    R-compiled "," PHP artisan optimize "]," post-create-project-cmd ": [ "PHP ArtisAn key:generate "]}," config ": {" Preferred-install ":" Dist " }, "minimum-stability": "Stable", "repositories": [{"Type": "Composer", "url": "H         ttp://pkg.phpcomposer.com/repo/packagist/"}, {" Packagist ": false}]}

The above describes the composer update is not successful, enable the configuration of the domestic mirror site change method, including the content, I hope that the PHP tutorial interested in a friend to help.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.