当前位置: 首页 > news >正文

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>

相关文章:

  • 面试
  • 深入浅出——float
  • 为Docker配置阿里加速器,系统为Debian8
  • 利用Scikit-Learn和Spark预测Airbnb的listing价格
  • H264中的SPS、PPS提取与作用转
  • 4G VoLTE存在漏洞可导致手机用户地理位置和其它个人信息泄露
  • Java框架搭建-Maven、Mybatis、Spring MVC整合搭建
  • 突破你的想象 OPPO R11s新升级
  • 仓储层到多维数据库
  • linux学习——管道
  • http协议的详解
  • sqlite3
  • 90平米的房间,路由器选择指南
  • 深入理解 CSS3 弹性盒布局模型
  • 乐在其中设计模式(C#) - 代理模式(Proxy Pattern)
  • C++类中的特殊成员函数
  • ECMAScript6(0):ES6简明参考手册
  • ES6核心特性
  • Java反射-动态类加载和重新加载
  • Java知识点总结(JDBC-连接步骤及CRUD)
  • node入门
  • Object.assign方法不能实现深复制
  • sessionStorage和localStorage
  • Storybook 5.0正式发布:有史以来变化最大的版本\n
  • 不上全站https的网站你们就等着被恶心死吧
  • 创建一种深思熟虑的文化
  • 从tcpdump抓包看TCP/IP协议
  • 第2章 网络文档
  • 翻译--Thinking in React
  • 分布式事物理论与实践
  • 聊聊hikari连接池的leakDetectionThreshold
  • 前端面试之闭包
  • 入门级的git使用指北
  • 扫描识别控件Dynamic Web TWAIN v12.2发布,改进SSL证书
  • 一些基于React、Vue、Node.js、MongoDB技术栈的实践项目
  • 国内唯一,阿里云入选全球区块链云服务报告,领先AWS、Google ...
  • 支付宝花15年解决的这个问题,顶得上做出十个支付宝 ...
  • ​HTTP与HTTPS:网络通信的安全卫士
  • ​无人机石油管道巡检方案新亮点:灵活准确又高效
  • # Swust 12th acm 邀请赛# [ A ] A+B problem [题解]
  • #pragma 指令
  • #Spring-boot高级
  • #单片机(TB6600驱动42步进电机)
  • #我与Java虚拟机的故事#连载15:完整阅读的第一本技术书籍
  • #中国IT界的第一本漂流日记 传递IT正能量# 【分享得“IT漂友”勋章】
  • $.ajax中的eval及dataType
  • (30)数组元素和与数字和的绝对差
  • (C++)栈的链式存储结构(出栈、入栈、判空、遍历、销毁)(数据结构与算法)
  • (笔试题)分解质因式
  • (附源码)spring boot公选课在线选课系统 毕业设计 142011
  • (附源码)计算机毕业设计SSM智慧停车系统
  • (力扣题库)跳跃游戏II(c++)
  • (转)nsfocus-绿盟科技笔试题目
  • (转)创业家杂志:UCWEB天使第一步
  • .【机器学习】隐马尔可夫模型(Hidden Markov Model,HMM)