ThinkPHP 6.0 foundation tutorial – Installation

Time:2020-11-21

ThinkPHP6.0Environment:

PHP >= 7.1.0

My local environment:

installPhpStudy

If you have already installedPhpStudyOr other environment, please ignore hereThinkPHP 6.0 foundation tutorial - Installation

ThinkPHP 6.0 foundation tutorial - Installation

The installation method is very simple, and it can be done by the next step

matters needing attention

  1. The installation path cannot contain “Chinese” or “space”, otherwise an error will be reported during startup (for example, the error prompt: can’t change dir to ‘G: B0 / x5efa / x6587 \)
  2. Ensure that the installation path is pure. There can be no installed version of V8 under the installation path. If you want to re install, please choose another path

After the installation is successful, you can start the service.

installComposer

6.0Version start, must passComposerWay to install and update, so you can’t go throughGitDownload and install.

I think after thatTPCan be smoothly upgraded, not every version is incompatibleThinkPHP 6.0 foundation tutorial - Installation

If you have already installedComposer, please ignore hereThinkPHP 6.0 foundation tutorial - Installation

Be sure to install PHP correctly. Open a command line window and execute PHP – V to see if the version number is output correctly.

Open the command line and execute the following commands to install the latest version of Composer:

  • The command line window doesn’t know what it is?win+rinputcmd,
  • Is PHP not an internal or external command?Right click the computer > Properties > Advanced System Settings > environment variables > Path > EditCopied PHP path

1. Download the installation script

php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"

2. Perform the installation process

php composer-setup.php

3. Delete the installation script

php -r "unlink('composer-setup.php');"

4. Verify that the installation is successful

Open a command line window and execute`composer`As shown in the figure:

ThinkPHP 6.0 foundation tutorial - Installation

This means that you have successfully installed ~!

If you really don’t know how to install command line, you can go tocomposerOfficial websitehttps://getcomposer.org/download/

ThinkPHP 6.0 foundation tutorial - Installation

Click to download the installation package. Next step next step select PHP environment to finish next step~~

If you install with the packagecomposerThe following commands need to be executed:

Full image of alicloud composer full image of alicloud composer

Global configuration

All projects use this mirror address:

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

OK, we have installed the local environment andcomposerLet’s get back to business! ~

Thinkphpp6 stable installation

composer create-project topthink/think tp

ThinkPHP 6.0 foundation tutorial - Installation

Seeing this proves that you are close to success!

You can change the name of TP directory here. I changed it to ThinkPHP.

If you have installed it before, switch to yourApplication rootNext, and then execute the following command to update:

composer update topthink/framework
//Or
composer update

test run

Enter the command line and execute the following instructions

php think run
//If your port is occupied
php think run -p 8000

ThinkPHP 6.0 foundation tutorial - Installation

Browser accesshttp://127.0.0.1:8000/

ThinkPHP 6.0 foundation tutorial - Installation

emmm… Happy New Year That’s right. Seeing this proves you’ve made it. Congratulations

This work adoptsCC agreementThe author and the link to this article must be indicated in the reprint



Rather than lament that the road is difficult to walk, it is better to start at once.

Recommended Today

MVC and Vue

MVC and Vue This article was written on July 27, 2020 The first question is: is Vue an MVC or an MVVM framework? Wikipedia tells us: MVVM is a variant of PM, and PM is a variant of MVC. So to a certain extent, whether Vue is MVC or MVVM or not, its ideological direction […]