search

Home  >  Q&A  >  body text

[Exclusive full illustration] Download and installation of ThinkPHP6 framework

1. ThinkPHP Events

Now Let me tell you good news and bad news, which one should I listen to first?

Let me tell you the bad news first: There will never be ThinkPHP5.2 in the world again!

Good news: ThinkPHP5.2 has been officially renamed ThinkPHP6.0


2. Core functions and main features


3. Environmental requirements and source code download

3.1 Environmental requirements: PHP 7.1

2.2 Source code download

As we all know, starting from ThinkPHP5.1, the official website no longer provides framework source code download La

So, of course ThinkPHP6.0 (hereinafter referred to as TP6) cannot be downloaded from the official website

Where can I download it? Two ways

Composer and Git

Reference

Composer download and installation tutorial://m.sbmmt.com/code/30828.html

Git tutorial: //m.sbmmt.com/tool/git/

The most commonly used and officially recommended Composer# is below ##Methods to download the framework source code




##4. Composer download and installation

4.1 Mac / Linux

// 1. 下载composer.phar:
curl -sS https://getcomposer.org/installer | php

// 2. 将 composer 命令移动到bin目录,使之全局可用
mv composer.phar /usr/local/bin/composer

Note:

For MacOS 10.14, the user/local/bin folder does not exist and needs to be created manually

// 3. 设置中国全量镜像,提升访问速度
composer config -g repo.packagist composer https://packagist.phpcomposer.com

// 如果上面错误存在问题,请使用这个镜像地址
composer config -g repo.packagist composer https://packagist.laravel-china.org

4.2 Windows


Open https://www.phpcomposer.com/: Download the setup.exe installation program

4.3 Test

Enter the command

composer

in the terminal. If you see the command prompt message, it means the installation is successful

Jietu20190408-134842.jpg

4.4 updated version

composer selfupdate  // 终端执行该命令将composer更新到最新版


5. TP6 framework source code download

(1) Open Composer official website:https://www.phpcomposer.com/

Jietu20190408-133547.jpg



Open the installation package list, and a jump will occur, which will go to https:// packagist.org/

Enter the search keyword: topthink, the component packages related to the ThinkPHP framework will be listed below


Jietu20190408-133742.jpg


After opening, you can see the version label and installation instructions of ThinkPHP6.0

Jietu20190408-134356.jpg

##The following are Detailed framework source code download process:

// 打开终端,执行指令:
composer create-project topthink/think tp6 6.0.*-dev

/**
  * 指令中各个参数的解释:
  * `create-project`: 是composer中的项目创建命令
  * `topthink/think`: ThinkPHP的组件包
  * `tp6`: 是当前的项目目录(如果没有创建, 该命令会自动创建的)
  * `6.0.*-dev`: 要下载的版本标签
  */
  
// 以下是源码的下载中的提示信息
Installing topthink/think (6.0.x-dev 9ea8d9fd39a1aac440fd355cf8b4361130267bce)
- Installing topthink/think (6.0.x-dev 9ea8d9f):
Cloning 9ea8d9fd39
- Installing topthink/think (6.0.x-dev 9ea8d9f): Downloading (100%)
Created project in tp
Loading composer repositories with package information
Updating dependencies (including require-dev)

Package operations: 9 installs, 0 updates, 0 removals
- Installing topthink/think-installer (v2.0.0): Downloading (100%)
- Installing opis/closure (3.1.6): Downloading (100%)
- Installing psr/simple-cache (1.0.1): Downloading (100%)
- Installing psr/log (1.1.0): Downloading (100%)
- Installing psr/container (1.0.0): Downloading (100%)
- Installing psr/cache (1.0.1): Downloading (100%)
- Installing topthink/framework (6.0.x-dev e9af162): Downloading (100%)
- Installing topthink/think-template (v2.0.1): Downloading (100%)
- Installing topthink/think-view (v1.0.5): Downloading (100%)
Writing lock file
Generating autoload files

> @php think service:discover
Succeed!
> @php think vendor:publish
Succeed!

After the download is completed, open the project directory, for example: tp6, you can see the following directory structure:


Jietu20190408-140009.jpg




##6.Framework Test


The detailed steps are as follows:

// 1. 打开终端工具, 切换到当前的Web目录下面

// 2. 进入tp6项目目录
cd tp6

// 3. 创建本地服务器, 启动框架
php think run

// 提示用户在本机的8000商品开启了一个Web服务
ThinkPHP Development server is started On <http://127.0.0.1:8000/>
You can exit with `CTRL-C`

Open browsing according to the prompts device, enter:

127.0.0.1:8000

or localhost:8000 in the address bar, the following interface will be displayed

Jietu20190408-140846.jpg

Congratulations, the ThinkPHP6 framework has been installed successfully~~


Want to experience TinkPHP6 now? Download the source code and click here:

http ://m.sbmmt.com/xiazai/code/5685

Related reference recommendations:

1.


ThinkPHP6.0 version is officially released, fully embracing component development trend

2. ThinkPHP6.0 Quick Start (Video Tutorial)

3. ThinkPHP6.0 Complete Development Manual (Official Version)

天蓬老师天蓬老师2056 days ago37722

reply all(24)I'll reply

  • 奔跑者

    奔跑者2019-05-14 14:53:29

    tp6 It’s not possible to export excel using the header. Does anyone know what’s going on? I’m waiting online. Urgent, I’m using it in the project.

    reply
    0
  • 缠中说禅

    缠中说禅2019-04-17 14:54:10

    Although I am a beginner in PHP and have played front-end before, I still hope to learn more about Mr. Zhu’s courses and support you

    reply
    0
  • Oliver Joe

    Oliver Joe2019-04-16 19:47:04

    Looking forward to ThinkPHP getting better and better

    reply
    0
  • 稚初

    稚初2019-04-08 19:06:32

    Can't learn anymore

    reply
    5
  • 天蓬老师

    Since you have chosen the far away place, all that is left to this world is your back.

    天蓬老师 · 2019-04-08 21:57:17
  • z老师

    z老师2019-04-08 16:09:26

    For students who don’t know Composer yet, you can learn it hard!

    reply
    1
  • 奔跑者

    tp6 cannot use header to export excel. Does anyone know what’s going on? Waiting online. Urgent. I’m using it in the project.

    奔跑者 · 2019-05-14 14:22:55
  • 藏色散人

    藏色散人2019-04-08 15:56:04

    Like it! ! !

    reply
    1
  • 天蓬老师

    天蓬老师2019-04-08 15:52:17

    The debate between component development and framework development in PHP has never stopped in recent years. Now that the framework has also been componentized, this debate can be put to an end for the time being~~

    New ThinkPHP6 framework, source code It has achieved componentized loading and is seamlessly connected with the models of international mainstream frameworks (such as laravel). It will definitely become a strong competitor of the frameworks of international major manufacturers~~

    php Chinese website will be launched in a timely manner according to the needs of small partners. ThinkPHP6 series of graphic tutorials, welcome everyone to roar below, let us continue this public welfare

    reply
    11
  • 时光乱了谁的心

    Hohohohohohohohoho

    时光乱了谁的心 · 2019-04-09 15:37:22
    烛光

    I would like to ask, what are the advantages of thinPHP6.0 compared to laravel?

    烛光 · 2019-04-09 16:20:34
    天蓬老师

    ThinkPHP6.0 has not yet been compared, but ThinkPHP5.1 has been. The parsing speed of the route based on the number of loaded files is faster than Laravel, but Laravel's ecology is obviously better than ThinkPHP. Each has its own merits.

    天蓬老师 · 2019-04-09 18:05:12
    赵亮

    Teacher, please support me. It would be best if you can provide video tutorials as soon as possible! I feel that thinkphp updates too quickly now. Will this affect the performance of thinkphp?

    赵亮 · 2019-04-10 10:18:59
    天蓬老师

    The video is already being planned....

    天蓬老师 · 2019-04-13 09:25:56
    飞仕

    Teacher Peter’s course is great. I have carefully studied TP5.1 and am looking forward to Teacher Zhu’s TP6.0 course! ! !

    飞仕 · 2019-04-18 11:38:40
    张

    Ho ho ho

    · 2019-04-18 17:30:27
    郭蝈

    Hohohohohohohohoho

    郭蝈 · 2019-05-06 15:33:42
    正大光明

    Thank you, teacher, for explaining it in detail. There are not many videos, but they are definitely excellent. Even if my English is poor, I can explain it in Chinese. Thank you teacher.

    正大光明 · 2019-05-31 09:21:31
    紫蔷*

    I just learned thinkphp6 and it was a bit difficult to learn. I was confused when I read the manual.

    紫蔷* · 2019-11-19 10:35:19
  • Cancelreply