Home > PHP Framework > YII > body text

What should I do if composer fails to install yii?

王林
Release: 2020-02-26 17:15:11
Original
3112 people have browsed it

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
Copy after login

Individual project configuration:

composer config repo.packagist composer https://packagist.phpcomposer.com
Copy after login

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
Copy after login

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',
        ],
        ...
]
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template