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并下载安装(要求能vpn翻墙)

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>

7:测试

win10使用Composer-Setup安装Composer以及使用Composer安装Yii2最新版的更多相关文章

  1. composer的安装以及laravel框架的安装(一)

    laravel号称世界上最好的php框架,没有之一,下面介绍它的安装 laravel学习交流qq群:293798134 composer的安装 : php开发者很多,并且在web开发领域占据绝对统治地 ...

  2. windows下composer安装不了或composer命令无效的解决办法

    安装方法: http://docs.phpcomposer.com/00-intro.html#Installation-Windows (官方中文帮助文档) 问题描述1: 通过Composer-Se ...

  3. 把git上的larave项目通过SourceTree安装上再通过composer安装依赖库

    1.项目地址克隆 https://gitee.com/fps2tao/laravel5.5-alitaobao.git 通过SourceTree工具下载到本地 2.在命令行方式打开项目地址安装依赖库( ...

  4. 用composer安装php代码(以安装phpmailer为例)

    1.安装composer.exe软件 2.下载composer.phar 3.创建composer.json文件 { "require": { "php": & ...

  5. 如何在Debian上安装和使用PHP Composer

    1.条件 shell使用sudo权限访问正在运行的debian系统. 必须安装和配置5.3或更高版本的PHP. 2.在Debian上安装Composer 可以通过运行以下命令从getcomposer. ...

  6. win10操作系统下oracle11g客户端/服务端的下载安装配置卸载总结

    win10操作系统下oracle11g客户端/服务端的下载安装配置卸载总结 一:前提 注意:现在有两种安装的方式 1. oracle11g服务端(64位)+oracle客户端(32位)+plsql(3 ...

  7. php私有组件以及创建自己的composer私有组件(packagist+git+composer)

    1.私有组件 大多数时候我们使用的都是公开可用的开源组件,但有时候如果公司使用内部开发的PHP组件,而基于许可证和安全方面的问题不能将其开源,就需要使用私有组件.对Composer而言,这是小菜一碟. ...

  8. Inno Setup入门(十一)——完成安装后执行某些程序

    Inno Setup入门(十一)——完成安装后执行某些程序 2011-02-16 16:24:23|  分类: Inno Setup |  标签:inno  setup   |举报 |字号 订阅   ...

  9. 使用Inno Setup 打包.NET程序,并自动安装.Net Framework

    使用Inno Setup 打包.NET程序,并自动安装.Net Framework http://www.cnblogs.com/xiaogangqq123/archive/2012/03/19/24 ...

随机推荐

  1. JAVA设计模式之工厂方法模式

    在阎宏博士的<JAVA与模式>一书中开头是这样描述工厂方法模式的: 工厂方法模式是类的创建模式,又叫做虚拟构造子(Virtual Constructor)模式或者多态性工厂(Polymor ...

  2. path和classpath

    对于Java的初学者,这两个环境变量,总是要遇到的.这里做一下总结. 1.path和classpath的含义 path是Windows操作系统的一个环境变量. 当操作系统需要运行一个程序,它需要知道该 ...

  3. listed

    http://sebastianruder.com/optimizing-gradient-descent/ http://www.nag.co.uk/pss/nag-and-algorithmic- ...

  4. 解决hibernate只能插入一条数据的问题

    hibernate初学,根据视频教程写好代码后,发现无论执行多少次main函数,数据库中只有一条数据,尝试多次,后来终于发现问题... 使用的工具是:MYSQL 5.7.13   eclipse 4. ...

  5. CSS+HTML网页设计与布局(学习笔记1)

    1.在宽度未知时,使div块居中,可以添加以下属性: display:table;margin:0 auto;

  6. c#基础-类型基础深入了解

    对象类型需要动态内存,基础类型需要静态内存 动态内存分配在堆上,静态内存分配在栈上. 静态内存保存着简单的变量,如 int a=0; 值类型:把一个值类型赋值给另外一个值类型,改变其中一个另外一个不会 ...

  7. golang 格式化时间为字符串

    package main import ( "fmt" "reflect" "time" ) func main() { //格式化字符串为 ...

  8. C# 委托的学习

    delegate int GetCalculatedValueDelegate(int x, int y);    //定义是个委托实际上就是抽象一类  参数列表形式和返回值相同的函数AddCalcu ...

  9. PHP基本问题

    WampServer修改端口及菜单Localhost http://www.wuwenhui.cn/3047.html WAMPServer默认配置更改-web根目录 http://blog.csdn ...

  10. 在eclipse之中使用Junit

    使用Junit单位测试,能够一定程度上减小项目bug的产生.很多时候,我们都是在main函数里面单独去测试一个方法,这样的测试非常不方便.使用Junit可以是测试单位和项目代码分离,一次性测试多个方法 ...