博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
win10使用Composer-Setup安装Composer以及使用Composer安装Yii2最新版
阅读量:4641 次
发布时间:2019-06-09

本文共 5965 字,大约阅读时间需要 19 分钟。

1:下载 ca-bundle.crt和cacert.pem(见导航栏——文件)

将这两个文件放在php目录下

2:php.ini中添加上述两个文件的路径

curl.cainfo=C:/xampp/php/ca-bundle.crt

openssl.cafile=C:/xampp/php/ca-bundle.crt

写到最后一行就可以

3:下载Composer-Setup.exe

https://getcomposer.org/download/

在该页面找到Composer-Setup.exe并下载安装(要求能vpnFQ)

4:安装如果出现错误

Notice: Undefined variable: caBundle in - on line 892

出现该错误的时候,找到错误路径打开install文件,找到892行

红线的地方报caBundle未定义,手动改成如下:

改完之后保存文件,并且退出Composer-Setup.exe(不要继续安装),然后重新安装,不报错,走完安装过程

5:验证安装结果:

6:安装Yii2

在服务器上建立访问目录yii2,

在github的个人信息的设置上生成一个token,后面创建项目的时候提示token(hidden)的时候将这个token复制上去

参照

http://www.yiiframework.com/download/

安装Yii2的最新版本,

注意要将下面这两行创建命令

php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.6 改为:
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project yiisoft/yii2-app-basic basic 2.0.6 如果是advanced项目:
composer create-project yiisoft/yii2-app-advanced advanced 2.0.6 然后等待安装,cmd显示如下:

Microsoft Windows [版本 10.0.10240] (c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\jzzq>cd C:\xampp\htdocs\yii2

C:\xampp\htdocs\yii2>php composer.phar global require "fxp/composer-asset-plugin:~1.1.1" Could not open input file: composer.phar

C:\xampp\htdocs\yii2>composer self-update You are already using composer version 03299ff075236be27be356498d6c64def973fe41.

C:\xampp\htdocs\yii2>php composer.phar global require "fxp/composer-asset-plugin:~1.1.1" Could not open input file: composer.phar

C:\xampp\htdocs\yii2>composer global require "fxp/composer-asset-plugin:~1.1.1" Changed current directory to C:/Users/jzzq/AppData/Roaming/Composer Deprecation Notice: The Composer\Package\LinkConstraint\MultiConstraint class is deprecated, use Composer\Semver\Constraint\MultiConstraint instead. in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Package/LinkConstraint/MultiConstraint.php:17 Deprecation Notice: The Composer\Package\LinkConstraint\LinkConstraintInterface interface is deprecated, use Composer\Semver\Constraint\ConstraintInterface instead. in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Package/LinkConstraint/LinkConstraintInterface.php:17 ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev)   - Removing fxp/composer-asset-plugin (v1.0.3)   - Installing fxp/composer-asset-plugin (v1.1.1)     Downloading: 100%

Writing lock file Generating autoload files

C:\xampp\htdocs\yii2>php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.6 Could not open input file: composer.phar

C:\xampp\htdocs\yii2>composer create-project yiisoft/yii2-app-basic basic 2.0.6 Installing yiisoft/yii2-app-basic (2.0.6)   - Installing yiisoft/yii2-app-basic (2.0.6)     Loading from cache

Created project in basic Loading composer repositories with package information Installing dependencies (including require-dev)   - Installing yiisoft/yii2-composer (2.0.3)     Loading from cache

  - Installing ezyang/htmlpurifier (v4.6.0)     Loading from cache

  - Installing bower-asset/jquery (2.1.4)     Loading from cache

  - Installing bower-asset/yii2-pjax (v2.0.5)     Loading from cache

  - Installing bower-asset/punycode (v1.3.2)     Loading from cache

  - Installing bower-asset/jquery.inputmask (3.1.63)     Loading from cache

  - Installing cebe/markdown (1.1.0)     Loading from cache

  - Installing yiisoft/yii2 (2.0.6)     Loading from cache

  - Installing swiftmailer/swiftmailer (v5.4.1)     Loading from cache

  - Installing yiisoft/yii2-swiftmailer (2.0.4)     Loading from cache

  - Installing yiisoft/yii2-codeception (2.0.4)     Loading from cache

  - Installing bower-asset/bootstrap (v3.3.5)     Loading from cache

  - Installing yiisoft/yii2-bootstrap (2.0.5)     Loading from cache

  - Installing yiisoft/yii2-debug (2.0.5)     Loading from cache

  - Installing bower-asset/typeahead.js (v0.10.5)     Loading from cache

  - Installing phpspec/php-diff (v1.0.2)     Loading from cache

  - Installing yiisoft/yii2-gii (2.0.4)     Loading from cache

  - Installing fzaninotto/faker (v1.5.0)     Loading from cache

  - Installing yiisoft/yii2-faker (2.0.3)     Loading from cache

fzaninotto/faker suggests installing ext-intl (*) Writing lock file Generating autoload files > yii\composer\Installer::postCreateProject chmod('runtime', 0777)...done. chmod('web/assets', 0777)...done. chmod('yii', 0755)...done.

C:\xampp\htdocs\yii2>composer create-project yiisoft/yii2-app-advanced advanced 2.0.6 Installing yiisoft/yii2-app-advanced (2.0.6)   - Installing yiisoft/yii2-app-advanced (2.0.6)     Downloading: 100%

Created project in advanced Loading composer repositories with package information Installing dependencies (including require-dev)   - Installing yiisoft/yii2-composer (2.0.3)     Loading from cache

  - Installing ezyang/htmlpurifier (v4.6.0)     Loading from cache

  - Installing cebe/markdown (1.1.0)     Loading from cache

  - Installing bower-asset/jquery (2.1.4)     Loading from cache

  - Installing bower-asset/jquery.inputmask (3.1.63)     Loading from cache

  - Installing bower-asset/punycode (v1.3.2)     Loading from cache

  - Installing bower-asset/yii2-pjax (v2.0.5)     Loading from cache

  - Installing yiisoft/yii2 (2.0.6)     Loading from cache

  - Installing swiftmailer/swiftmailer (v5.4.1)     Loading from cache

  - Installing yiisoft/yii2-swiftmailer (2.0.4)     Loading from cache

  - Installing yiisoft/yii2-codeception (2.0.4)     Loading from cache

  - Installing bower-asset/bootstrap (v3.3.5)     Loading from cache

  - Installing yiisoft/yii2-bootstrap (2.0.5)     Loading from cache

  - Installing yiisoft/yii2-debug (2.0.5)     Loading from cache

  - Installing bower-asset/typeahead.js (v0.10.5)     Loading from cache

  - Installing phpspec/php-diff (v1.0.2)     Loading from cache

  - Installing yiisoft/yii2-gii (2.0.4)     Loading from cache

  - Installing fzaninotto/faker (v1.5.0)     Loading from cache

  - Installing yiisoft/yii2-faker (2.0.3)     Loading from cache

fzaninotto/faker suggests installing ext-intl (*) Writing lock file Generating autoload files

C:\xampp\htdocs\yii2>

转载于:https://www.cnblogs.com/caicaizi/p/5625435.html

你可能感兴趣的文章
mysql搭建主从数据库
查看>>
新的一年,新的开始
查看>>
python模块struct
查看>>
图像的灰度级和动态范围(转)
查看>>
C# MODBUS协议 上位机(转)
查看>>
CSS box-shadow 属性
查看>>
vue:图片切换动态显示
查看>>
备忘录
查看>>
软件工程个人作业02
查看>>
pip install 问题
查看>>
vue-router导航守卫,限制页面访问权限
查看>>
2019 Multi-University Training Contest 1 - 1012 - NTT
查看>>
浏览器调试淘宝首页看到有趣的招聘信息
查看>>
ASP.NET Identity “角色-权限”管理 4
查看>>
[转][译]ASP.NET MVC 4 移动特性
查看>>
SOC CPU
查看>>
get_result --perl
查看>>
163镜像地址
查看>>
ehcache memcache redis 三大缓存男高音
查看>>
eclipse 快捷键Open Implementation 直接退出
查看>>