您的位置 首页 php

composer安装yii失败怎么办

1、使用composer国区镜像

全局配置:

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

项目单独配置:

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

推荐教程:yii框架

2、删除composer.json中默认的仓库配置

378cabf508d8657609df3a904735b5c.png

3、解决bower依赖

composer require yidas/yii2-bower-asset

然后我们看到依赖开始安装, composer安装失败的主要原因是默认的仓库访问很慢, 直接使用国区镜像, 需要解决bower依赖。

215bb4c2be99fbddd2b497d7ab60d8d.png

4、修改bower配置: config/web.php, 将别名指向@vendor/yidas/yii2-bower-asset/bower

68f0ccf864ec35f8f9c4b5c393f2fa7.png

如果没有配置密钥,需要在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',        ],        ...]

更多编程相关内容,请关注php中文网编程入门栏目!

文章来源:智云一二三科技

文章标题:composer安装yii失败怎么办

文章地址:https://www.zhihuclub.com/28244.shtml

关于作者: 智云科技

热门文章

网站地图