composer 安装thinkphp

 

 使用git安装thinkphp5.1

 

git下载后500报错,开启报错

tp5\config\app.php 设置

// 显示错误信息
'show_error_msg' => true,

 

出现报错:Cannot use think\facade\Lang as Lang because the name is already in use

解决办法

tp5\thinkphp\library\think\Request.php 里去掉 

use think\facade\Lang;

 

www  WEB部署目录(或者子目录)
├─application           应用目录
│  ├─common             公共模块目录(可以更改)
│  ├─module_name        模块目录
│  │  ├─common.php      模块函数文件
│  │  ├─controller      控制器目录
│  │  ├─model           模型目录
│  │  ├─view            视图目录
│  │  └─ ...            更多类库目录
│  │
│  ├─command.php        命令行定义文件
│  ├─common.php         公共函数文件
│  └─tags.php           应用行为扩展定义文件
│
├─config                应用配置目录
│  ├─module_name        模块配置目录
│  │  ├─database.php    数据库配置
│  │  ├─cache           缓存配置
│  │  └─ ...            
│  │
│  ├─app.php            应用配置
│  ├─cache.php          缓存配置
│  ├─cookie.php         Cookie配置
│  ├─database.php       数据库配置
│  ├─log.php            日志配置
│  ├─session.php        Session配置
│  ├─template.php       模板引擎配置
│  └─trace.php          Trace配置
│
├─route                 路由定义目录
│  ├─route.php          路由定义
│  └─...                更多
│
├─public                WEB目录(对外访问目录)
│  ├─index.php          入口文件
│  ├─router.php         快速测试文件
│  └─.htaccess          用于apache的重写
│
├─thinkphp              框架系统目录
│  ├─lang               语言文件目录
│  ├─library            框架类库目录
│  │  ├─think           Think类库包目录
│  │  └─traits          系统Trait目录
│  │
│  ├─tpl                系统模板目录
│  ├─base.php           基础定义文件
│  ├─console.php        控制台入口文件
│  ├─convention.php     框架惯例配置文件
│  ├─helper.php         助手函数文件
│  ├─phpunit.xml        phpunit配置文件
│  └─start.php          框架入口文件
│
├─extend                扩展类库目录
├─runtime               应用的运行时目录(可写,可定制)
├─vendor                第三方类库目录(Composer依赖库)
├─build.php             自动生成定义文件(参考)
├─composer.json         composer 定义文件
├─LICENSE.txt           授权说明文件
├─README.md             README 文件
├─think                 命令行入口文件

  

 安装应用目录

D:\cmf\cec\composer\tp5>git clone https://github.com/top-think/think tp5

安装核心库

D:\cmf\cec\composer\tp5>cd tp5

D:\cmf\cec\composer\tp5>git clone https://github.com/top-think/framework thinkphp

 

composer安装

D:\cmf\cec\composer>composer config -g repo.packagist composer https://packagist.laravel-china.org

D:\cmf\cec\composer>composer create-project topthink/think thinkphp5

D:\cmf\cec\composer>composer create-project topthink/think thinkphp5
Installing topthink/think (v5.0.20)
  - Installing topthink/think (v5.0.20): Downloading (100%)
Created project in thinkphp5
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing topthink/think-installer (v1.0.12): Downloading (100%)
  - Installing topthink/framework (v5.0.21): Downloading (100%)
Writing lock file
Generating autoload files  

 

现在稳定版本貌似是v5.0.21 不知道为啥用git到5.1版本总是报错

 

composer下载  直接下载

github thinkphp

posted @ 2018-08-27 13:46  星耀学园  阅读(940)  评论(0)    收藏  举报