[Exclusive full illustration] Download and installation of ThinkPHP6 framework
天蓬老师
天蓬老师 2019-04-08 14:15:42
0
24
37715

1. ThinkPHP Events

  • On April 27, 2017, ThinkPHP5.1-beta.1 was released

  • On December 31, 2017, ThinkPHP5.1.0 was released, marking the rapid entry into the iteration period

  • On March 3, 2019, ThinkPHP5.1 has been updated to the 35th version (5.1.35)

  • On March 22, 2019, the dev development version of ThinkPHP5.2 was also released

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

  • Comprehensive support for the use of PHP7 strong type features

  • Comprehensive support for almost all PSR development specifications

  • Achieved multi-application support

  • Comprehensive introduction of event system alternative behavior

  • New application service architecture

  • The view and template engine are separated, and the project configuration is more flexible.

  • IDE assistant makes the editor’s smart prompts more accurate

  • For the original version Some functions and class methods have been unified and streamlined


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:http://www.php.cn/code/30828.html

Git tutorial: http://www.php.cn/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

    Here we use the framework’s built-in
  • think

    command test

  • This command will start a local temporary Web server with the same function as
  • php -S localhost:8000

    It’s the same


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 ://www.php.cn/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)

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(7)
奔跑者

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.

缠中说禅

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

Oliver Joe

Looking forward to ThinkPHP getting better and better

悦影随心

Can't learn anymore

  • reply Since you have chosen the far away place, all that is left to this world is your back.
    天蓬老师 author 2019-04-08 21:57:17
钟老师

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

  • reply tp6 cannot use header to export excel. Does anyone know what’s going on? Waiting online. Urgent. I’m using it in the project.
    奔跑者 author 2019-05-14 14:22:55
藏色散人

Like it! ! !

Peter-Zhu

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 Hohohohohohohohoho
    时光乱了谁的心 author 2019-04-09 15:37:22
  • reply I would like to ask, what are the advantages of thinPHP6.0 compared to laravel?
    烛光 author 2019-04-09 16:20:34
  • reply 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.
    天蓬老师 author 2019-04-09 18:05:12
  • reply 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?
    赵亮 author 2019-04-10 10:18:59
  • reply The video is already being planned....
    天蓬老师 author 2019-04-13 09:25:56
  • reply Teacher Peter’s course is great. I have carefully studied TP5.1 and am looking forward to Teacher Zhu’s TP6.0 course! ! !
    飞仕 author 2019-04-18 11:38:40
  • reply Ho ho ho
    author 2019-04-18 17:30:27
  • reply Hohohohohohohohoho
    郭蝈 author 2019-05-06 15:33:42
  • reply 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.
    正大光明 author 2019-05-31 09:21:31
  • reply I just learned thinkphp6 and it was a bit difficult to learn. I was confused when I read the manual.
    紫蔷* author 2019-11-19 10:35:19
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template