6.0
At the beginning of the version, it must beComposer
installed and updated through methods, so you cannotGit
install through download.- PHP >= 7.1.0
1. Installation Composer
- In windows, download the Composer software
Step 1: Double-click the downloaded composer to run the program.
Step 2: Select the drive letter to be installed.
Step 3: Select the php version. If you are an integrated package environment, go to the integrated package to find php
. Step 4: All next steps
Two, set the Composer
download source
Composer
The download source set first is also the mirror address- Enter in the command line window or console
composer config -g repo.packagist composer https://packagist.phpcomposer.com
- The speed of foreign websites is slow, the official website is recommended to use domestic mirroring (Alibaba Cloud)
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer
If you use the phpstudy integrated development environment, the latest one can be installed directly on it Composer
as shown below:
The installation here is the same. After the installation is successful, it can be used on the cmd command line. I use Composer官网下载的应用程序安装的。
Three, Composer
download and install ThinkPHP6
- First switch to the root directory of the php environment
cd d:/phpstudy/www
- The download
Thinkphp6
command is executed. The last tp6 is to create a new tp6 directory, which can be changed
composer create-project topthink/think tp6
- Update the
Thinkphp6
core
composer update topthink/framework
- Preparation: The directory where the installation and update commands are located is different, and the update must be performed under your application root directory
Fourth, the directory structure after successful installation
- The main change in the directory structure of version 6.0 is that the core framework is incorporated into the
vendor
directory, and then the originalapplication
directory becomes aapp
directory. - The directory structure after installation is a single application mode
- Under the
mac
orlinux
environment, note that you need to set theruntime
directory permissions to 777
www WEB deployment directory (or subdirectory) ├─app application directory │ ├─controller Controller directory │ ├─model model catalog │ ├─ ... More class library catalog │ │ │ ├─common.php common function file │ └─event.php event definition file │ ├─config configuration directory │ ├─app.php application configuration │ ├─cache.php cache configuration │ ├─console.php console configuration │ ├─cookie.php Cookie configuration │ ├─database.php database configuration │ ├─filesystem.php file disk configuration │ ├─lang.php multi-language configuration │ ├─log.php log configuration │ ├─middleware.php middleware configuration │ ├─route.php URL and routing configuration │ ├─session.php Session configuration │ ├─trace.php Trace configuration │ └─view.php view configuration │ ├─view view directory ├─route route definition directory │ ├─route.php route definition file │ └─ ... │ ├─public WEB directory (external access directory) │ ├─index.php entry file │ ├─router.php quick test file │ └─.htaccess is used for apache rewriting │ ├─extend extension class library directory ├─runtime application runtime directory (writable, customizable) ├─vendor Composer class library directory ├─.example.env environment variable example file ├─composer.json composer definition file ├─LICENSE.txt authorization document ├─README.md README file ├─think command line entry file
Five, run Thinkphp6
Step 1: Open the integrated software-" Website- " Create a website Step 2: Enter the website domain name: www.xxx.com Step 3: Website directory: tp/public Step 4: Pay attention to the PHP version PHP >= 7.1.0 Step 5: Enter the domain name ( www.xxx.com ) directly on the browser. Note: If you write subsequent method calls, you don’t want to add index.php ( www.xxx.com/ index.php /test/i ndex )
phpstudy(此处用的是新版8.1.0.6)
ThinkPHP6 can go to find the root of public / .htaccess file you can modify the following input ( www.xxx.com/ the Test / i ndex) can access
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] </IfModule>