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. Flash插件地址

    Flash插件地址: http://get.adobe.com/cn/flashplayer/存档版本地址: http://helpx.adobe.com/flash-player/kb/archiv ...

  2. 构造方法Constructor

    构造函数的名称与类名相同,没有返回值类型,主要用于在创建对象的时候进行一些初始化操作,如一个类中没有构造方法,java会默认给一个无参的构造方法

  3. wget cooikes 下载

    2.下来用wget带cookie的命令下载,命令如下: wget -c –load-cookies=cookies.txt  ”下载地址” -O “文件名” &       [文件名处自己命名 ...

  4. html嵌套表格示例

    常用嵌套表格示例,出自<网页开发手记:HTML+CSS+JavaScript实战详解>   <html>   <head>   <title>嵌套表格布 ...

  5. 【原创】No matching distribution found for Twisted>=10.0.0 (from scrapy)

    系统  Ubuntu14.04 python  2.7.11 运行  pip install scrapy  报错: No matching distribution found for Twiste ...

  6. 解析利用wsdl.exe生成webservice代理类的详解

    利用wsdl.exe生成webservice代理类:根据提供的wsdl生成webservice代理类1.开始->程序->Visual Studio 2005 命令提示2.输入如下红色标记部 ...

  7. OpenSSL命令系列

    1.1 ssl命令系列前言 openssl命令的格式是"openssl command command-options args",command部分有很多种命令,这些命令需要依赖 ...

  8. Jmeter之逻辑控制器(Logic Controller)

    Jmeter之逻辑控制器(Logic Controller) 前言: 1. Jmeter官网对逻辑控制器的解释是:“Logic Controllers determine the order in w ...

  9. MongoDB-JAVA-Driver 3.2版本常用代码全整理(2) - 查询

    MongoDB的3.x版本Java驱动相对2.x做了全新的设计,类库和使用方法上有很大区别.例如用Document替换BasicDBObject.通过Builders类构建Bson替代直接输入$命令等 ...

  10. 这是一个比较清晰的SSH框架结构,有兴趣的博友可以看一下

    http://www.cnblogs.com/zhaowancheng/p/5841591.html