Download and install [Exclusive full illustrating] ThinkPHP6 frame

http://www.php.cn/wenda/159638.html

 

1. ThinkPHP Memorabilia

  • April 27, 2017, ThinkPHP5.1-beta.1 release

  • December 31, 2017, ThinkPHP5.1.0 release, marking the rapid access of iterations

  • March 3, 2019, ThinkPHP5.1 iteration to the 35th version update (5.1.35)

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

Now tell you a good news, bad news, to hear first?

First the bad news: there will never be ThinkPHP5.2 it on the rivers and lakes!

The good news:  ThinkPHP5.2 it has officially changed its name to ThinkPHP6.0


2. The core functions and main features

  • Full support for the use of strongly typed properties PHP7

  • Full support for almost all of the PSR development specifications

  • To achieve a multi-application support

  • Introduction of a comprehensive system to replace the event behavior

  • The new service application architecture

  • Views and templating engine to separate, more flexible project configuration

  • IDE assistant, the editor intellisense more accurate

  • The original version of some functions and class methods were unified and streamlined


3. Environmental requirements and source code download

3.1 Environmental requirements:   PHP 7.1+

2.2 Source download

As we all know, from the beginning ThinkPHP5.1, the official website is no longer providing a framework source code download it

So, ThinkPHP6.0 (hereinafter referred to TP6) and certainly not from the official website to download

Where to download it? Two ways

Composer and Git 

reference

Composer download and install tutorial: http://www.php.cn/code/30828.html

Git Tutorial: http://www.php.cn/tool/git/

Here the most common, is the official recommended Composer way to download the source code framework

 


 

4. Composer download and install

4.1 Mac / Linux

1

2

3

4

5

// 1. 下载composer.phar:

curl -sS https://getcomposer.org/installer | php

 

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

mv composer.phar /usr/local/bin/composer

Note: MacOS 10.14, user / local / bin folder does not exist, you need to manually create

1

2

3

4

5

// 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/: setup.exe installation program can be downloaded

4.3 Test

Terminal type: composer commands, see the command prompt information indicating successful installation

Jietu20190408-134842.jpg

Version 4.4 update

1

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


 

5. TP6 frame codes download

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

Jietu20190408-133547.jpg

 

 

Open the list of installation packages, which would prevent a branch to https://packagist.org/

Enter search keywords: topthink, will be listed in the following component packages associated with the framework of ThinkPHP

 

Jietu20190408-133742.jpg

 

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

Jietu20190408-134356.jpg

The following is a detailed framework source code download process:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

// 打开终端,执行指令:

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 complete, open the project directory, for example: tp6, see the following directory structure:

 

Jietu20190408-140009.jpg

 


 

6. Test frame

  • As used herein framework built-in command test think

  • This command will start a local temporary Web server, function and php -S localhost: 8000 is the same

 

Detail steps are as follows:

1

2

3

4

5

6

7

8

9

10

11

// 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 your browser and follow the prompts, enter in the address bar:

127.0.0.1:8000 or localhost: 8000, the interface is shown below

Jietu20190408-140846.jpg

Congratulations, ThinkPHP6 framework has been successfully installed ~~

 

? Want to download it now to experience TinkPHP6 Source ruthless poke here:  http://www.php.cn/xiazai/code/5685

Related reference recommended:
1.  ThinkPHP6.0 version officially released, to embrace the trend component-based development

2.  ThinkPHP6.0 Speed entry (video tutorial)

3.  ThinkPHP6.0 fully developed manual (official version)

Guess you like

Origin blog.csdn.net/james_laughing/article/details/93714821