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. Delphi完成的断点续传例子 转

    unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...

  2. 课堂笔记--Strom并发模型

    Strom并发模型:     topology是如何运行的?(可与mapreduce对比)         第一层:cluster         第二层:supervisor(host.node.机 ...

  3. 转载自@机智的新手:使用Auto Layout中的VFL(Visual format language)--代码实现自动布局

    本文将通过简单的UI来说明如何用VFL来实现自动布局.在自动布局的时候避免不了使用代码来加以优化以及根据内容来实现不同的UI. 一:API介绍 NSLayoutConstraint API 1 2 3 ...

  4. 关于JQuery的一些知识点

    1.jQuery的入口函数 1.1 语法jQuery(document).read(function(){ }); $(function(){ });// ** window.onlaod = fun ...

  5. ie6并不是不支持!important

    之前对ie6接触不多,并且认识也不深,虽然知道ie6中的!important很特别,但是并没有记住特别在哪里~今天就记录一下吧! 首先,很多人说ie6是不支持!important的,其实这个一个错误的 ...

  6. python调用jar包类

    #!/usr/bin/python2.7#coding:utf8import sysimport jpypeimport os.path phone_num = sys.argv[1]#jarpath ...

  7. 自定义UITableViewCell

    随着日常的使用,系统提供的cell已经不能满足开发的需要,因为系统提供的是单一的,所以 这就引来了自定义cell的出现,可以根据 自己的需要来布局各个控件所处的位置.不同位置显示不同的控件. 创建一个 ...

  8. php 连接mongodb 增查改删操作

    查询 <?php $m=new MongoClient('mongodb://admin:admin@localhost:27017/admin'); $db=$m->hndb; $cc= ...

  9. 使用WCF 测试客户端测试你的WCF服务

    wcftestclient.exe是一个GUI的工具用于测试WCF,只需在Visual studio command line 窗口中键入 wcftestclient,就启动这个程序.如下图: 然后通 ...

  10. Mysql 存储过程基本语法

    delimiter //一般情况下MYSQL以:结尾表示确认输入并执行语句,但在存储过程中:不是表示结束,因此可以用该命令将:号改为//表示确认输入并执行. 一.创建存储过程 1.基本语法: crea ...