The composer fails to be updated. how can I change the configurations of a domestic Image website?

Source: Internet
Author: User
: This article mainly introduces how to change the configuration of the domestic Image website when the composer is not updated successfully. if you are interested in the PHP Tutorial, refer to it. Usage:

You can enable the image service in either of the following ways:

  1. Add the following configuration information to the configuration file config. json of Composer (global configuration of the system ). See "example 1"
  2. Add the following configuration information to the composer. json file of your project (for a single project ). See "example 2"
To avoid executing two queries during the installation package, you must add the following settings to disable packagist:
        {            "repositories": [                {"type": "composer", "url": "http://pkg.phpcomposer.com/repo/packagist/"},                {"packagist": false}            ]        }        
Example 1: modify the composer configuration file

View the main directory of composer:composer config -l -gCommand to list the global configuration information of composer.[home]The configuration item is the main directory of composer. Runsudo composer config -l -gCommand.

Go to the main directory of composer, open the config. json file (if there is no such file), and add the configuration information of the image service. The final content is as follows:

        {            "config": {            },            "repositories": [                {"type": "composer", "url": "http://pkg.phpcomposer.com/repo/packagist/"},                {"packagist": false}            ]        }        
Example 2: Use the composer. json configuration file of the laravel project as an example to add the configuration information of the image service 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": [                    "app/commands",                    "app/controllers",                    "app/models",                    "app/database/migrations",                    "app/database/seeds",                    "app/tests/TestCase.php"                ]            },            "scripts": {                "post-install-cmd": [                    "php artisan clear-compiled",                    "php artisan optimize"                ],                "post-update-cmd": [                    "php artisan clear-compiled",                    "php artisan optimize"                ],                "post-create-project-cmd": [                    "php artisan key:generate"                ]            },            "config": {                "preferred-install": "dist"            },            "minimum-stability": "stable",            "repositories": [                {"type": "composer", "url": "http://pkg.phpcomposer.com/repo/packagist/"},                {"packagist": false}            ]        }        

The above describes how to enable the configuration change of the domestic Image website when the composer is not updated successfully, including some content. I hope to help anyone who is interested in the PHP Tutorial.

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.