composer安装yii2

今天想在台式机里安装一下yii2,想做就做,走你!!安装的一路上遇到了些问题,一点点解决,所以记录下来。

大家都知道安装yii2有两种方法。一种是用composer安装,一种是冲社区里直接下载,我选择了composer。

至于原因就是感觉这个东西挺好玩的,就顺便熟悉一下。

根据文档是要在composer中执行这两个命令:

composer global require "fxp/composer-asset-plugin:^1.2.0"

composer create-project --prefer-dist yiisoft/yii2-app-basic basic

执行第一个命令时候报错了!!!!

1、The openssl extension is required for SSL/TLS protection but is not availab
le. If you can not enable the openssl extension, you can disable this error
, at your own risk, by setting the 'disable-tls' option to true.


这段报错的意思是php版本里缺少ssl扩展,那么直接打开php.ini看看里面有没有ssl的扩展
我的里面直接就找到了,前面注释了,打开保存一下重启php


2、接着搞,突然又来了个麻烦
"C:/Users/xxxx/AppData/Roaming/Composer/auth.json" for future use by Composer.


需要输入token ,什么鬼啊!!看样子跟githup有关,好像是有个githup API的下载数要限制,需要各个令牌 目录下没有auth.json文件

那么登录githup 看看设置,果然有个Personal access token


点击进去一看,可以创建一个token 果断点击看看,好多选项要看情况选择一下然后点击创建


之后会有一个token 复制一下黏贴到cmd中就ok了


静静的等待一会儿


成功了!这之前遇到了一个问题,那就是用composer下载yii2没有vender文件夹,重新走一遍这个流程就好了,可能是生成token的时候

缺失了什么造成的.


猜你喜欢

转载自blog.csdn.net/qq_32936067/article/details/61203003