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. Django进阶篇(一)

    Form django中的Form一般有两种功能: 1.输入html 2.验证用户输入 最简易的form验证: <!DOCTYPE html> <html lang="en ...

  2. django时区设置

    1. 创建web目录 django-admin.py startproject mysite 2. 启动web服务 python manage.py runserver python manage.p ...

  3. out参数,ref参数,params参数数组

    params参数数组 params关键字可以为方法指定数目可变的参数.params关键字修饰的参数,可以传入任意数目的同类型参数,甚至可以不传入参数. 不过params修饰的参数必须是方法的最后一个参 ...

  4. IMX6下移植WKxxx驱动

    wkXXX.c #include<linux/init.h> #include <linux/module.h> #include <linux/kernel.h> ...

  5. TCP/IP协议学习笔记

    计算机网络基础知识复习汇总:计算机网络基础知识复习 HTTP协议的解析:剖析 HTTP 协议 一个系列的解析文章: TCP/IP详解学习笔记(1)-- 概述 TCP/IP详解学习笔记(2)-- 数据链 ...

  6. jQuery实现抖动效果

    //抖动效果 //intShakes:抖动次数:intDistance:抖动左右距离:intDuration:持续时间 jQuery.fn.shake = function (intShakes, i ...

  7. NSString和NSMutableString的创建及其一些常用方法

    NSString和NSMutableString都是对象类型,是NSObject的子类.NSString是不可变字符串,NSMutableString是可变字符串 一.NSString的创建 1.创建 ...

  8. Hibernate day04笔记

    整合log4j(了解) slf4j 核心jar : slf4j-api-1.6.1.jar .slf4j是日志框架,将其他优秀的日志第三方进行整合.      整合导入jar包     log4j 核 ...

  9. DEBUG STACK TRACE for PoolBackedDataSource.close().

    我使用generator生成的代码,xml里面的内容没有覆盖重写,而是在下面直接追加,所以需要把以前的全部删除,然后在用generator生成.如果这个不能解决问题,就查查别人的问题.

  10. ArcGIS API for Flex实现GraphicsLayer上画点、线、面。

    目的: ArcGIS API for Flex实现GraphicsLayer上画点.线.面. 准备工作: 1.这次地图数据就用Esri提供的http://server.arcgisonline.com ...