: 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:
- Add the following configuration information to the configuration file config. json of Composer (global configuration of the system ). See "example 1"
- 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 -g
Command to list the global configuration information of composer.[home]
The configuration item is the main directory of composer. Runsudo composer config -l -g
Command.
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.