win10使用Composer-Setup安装Composer以及使用Composer安装Yii2最新版

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>

时间: 2024-08-05 15:15:52

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

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

1.安装composer.exe软件 2.下载composer.phar 3.创建composer.json文件 { "require": { "php": ">=5.5.9", "phpmailer/phpmailer": "~5.2" }, "config": { "preferred-install": "dist" }, "

composer的安装以及laravel框架的安装

laravel号称世界上最好的php框架,没有之一,下面介绍它的安装 laravel学习交流qq群:293798134 composer的安装 : php开发者很多,并且在web开发领域占据绝对统治地位.在20年的发展过程中,无数开发者开发了无数的类库.但是,当你想用某个库时,是怎么做的呢?比如:phpmailer,一个发邮件的库,我们往往这样做:1.  打开搜索引擎,搜索phpmailer.2.  从phpmailer官网或不知名的网站,下载源码.3.  解压然后放到自己的项目中,在看手册调用

【安装OS】联想Yago11s 安装win10

制作U盘启动盘 使用ULtraISO制作启动盘 参照:http://jingyan.baidu.com/article/a378c960630e61b329283045.html 修改联想Yago11s启动顺序 在关机状态下,按"开机键"左边的"一键恢复按钮",弯弯的箭头,拿笔顶一下. 在出现的菜单中,选择第二项"BIOS Setup"进入BIOS设置界面 进入设置界面后将Fast Boot禁用保存后退出 开始安装OS U盘插入电脑重启 按Fn+

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

Inno Setup入门(十一)——完成安装后执行某些程序 2011-02-16 16:24:23|  分类: Inno Setup |  标签:inno  setup   |举报 |字号 订阅 下载LOFTER客户端 有些时候我们的程序虽然能够很好的完成安装,但是程序的配置工作可能需要其他的一些程序来辅助完成,如果不执行这些程序,主程序就不能很好的完成工作,甚至不能完成工作,一个很明显的例子是,目前许多程序是通过NET技术开发的,这就要求计算机上必须安装有.net Framework,否则主程

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

使用Inno Setup 打包.NET程序,并自动安装.Net Framework http://www.cnblogs.com/xiaogangqq123/archive/2012/03/19/2405730.html Inno Setup是什么 Inno Setup 是一个windows系统下的安装包制作程序.它是免费的(而且允许免费用于商业用途).官网网站:http://www.jrsoftware.org/ 虽然说.NET 可以使用VS来打包安装包,但可定制化绝对不如Inno Setup

(转)Inno Setup入门(七)——提供安装语言选项

本文转载自:http://blog.csdn.net/yushanddddfenghailin/article/details/17250803 Inno Setup安装目录下有一个Languages的文件夹,该文件夹提供了可供使用的语言,通过在脚本中加入[languages]段,可以实现该项功能,实现代码如下: [setup] ;全局设置,本段必须 AppName=Test AppVerName=TEST DefaultDirName="E:\TEST" AppVersion=1.0

(转)Inno Setup入门(九)——修改安装过程中的文字显示

本文转载自:http://blog.csdn.net/yushanddddfenghailin/article/details/17250837 前面说到过可以使用不用的语言文件实现不同的显示方式,方便与国际接轨,事实上即使没有语言文件也可以实现修改.[Messages] 段用于定义安装程序和卸载程序中显示的消息.一般不需要创建 [Messages] 段,因为所有的消息在Inno Setup的Default.isl文件 (或在[Languages] 段指定的语言选项) 中已经包含.但是可以通过覆

(转)Inno Setup入门(二)——修改安装过程中的图片

本文转载自:http://blog.csdn.net/augusdi/article/details/8564793 修改安装过程中的图片 一般编译之后,安装过程中出现在左边图片是是下图这个样子的: 其实也可以修改它,只需要在setup段中作一点稍微的修改,加一行代码即可: [setup] AppName=Test AppVerName=TEST DefaultDirName="E:\TEST" AppVersion=1.0 WizardImageFile=dh.bmp [files]

win10 安装 mysql解压版安装步骤

参考资料:win 10 安装 mysql 5.7 网址:http://blog.sina.com.cn/s/blog_5f39af320102wbk0.html 本文参考上面的网址的教程,感谢作者分享. 我安装的是解压版,因为安装版并没有64位的,并且安装版也就是自动安装,节省了一部分配置操作, 反正是学习,就自己动手安装解压版64位. 下面我再把步骤说明一下: 1.下载,到MySQL官网:http://dev.mysql.com/ 点击Downloads=>Community=>MySQL