Home >PHP Framework >YII >What should I do if composer fails to install yii?

What should I do if composer fails to install yii?

王林
王林Original
2020-02-20 14:16:193135browse

What should I do if composer fails to install yii?

1. Use composer country image

Global configuration:

composer config -g repo.packagist composer https://packagist.phpcomposer.com

Individual project configuration:

composer config repo.packagist composer https://packagist.phpcomposer.com

Recommended tutorial: yii framework

2. Delete the default warehouse configuration in composer.json

What should I do if composer fails to install yii?

3. Solve the bower dependency

composer require yidas/yii2-bower-asset

Then we saw that the dependencies started to be installed. The main reason for composer installation failure was that the default warehouse access was very slow. If we directly use the national image, we need to solve the bower dependency.

What should I do if composer fails to install yii?

4. Modify bower configuration: config/web.php, point the alias to @vendor/yidas/yii2-bower-asset/bower

What should I do if composer fails to install yii?

If there is no configuration key, you need to add a key in config/web.php

'components' => [
        'request' => [
                    // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'your-key',
        ],
        ...
]

For more programming related content, please pay attention to the php Chinese websiteProgramming IntroductionColumn!

The above is the detailed content of What should I do if composer fails to install yii?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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