Home PHP Framework ThinkPHP Sharing and learning: TP6 project construction short record

Sharing and learning: TP6 project construction short record

Nov 01, 2021 pm 04:08 PM
tp6

下面thinkphp框架教程栏目将给大家分享一个thinkphp6 项目搭建小记录,希望对需要的朋友有所帮助!

Sharing and learning: TP6 project construction short record

thinkphp6 项目搭建记录

第一步:创建项目

composer create-project topthink/think "项目名称"
Copy after login

第二步:配置数据库链接

修改 .env 文件

[DATABASE]TYPE = mysqlHOSTNAME = 127.0.0.1DATABASE = 数据库USERNAME = 用户PASSWORD = 密码HOSTPORT = 3306CHARSET = utf8DEBUG = true
Copy after login

第三步:配置伪静态

Apache

<IfModule mod_rewrite.c>Options +FollowSymlinks -Multiviews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]</IfModule>SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
Copy after login

nginx

location / {
 if (!-e $request_filename) {
         rewrite  ^(.*)$  /index.php?s=/$1  last;
  }}
Copy after login

推荐:《最新的10个thinkphp视频教程

The above is the detailed content of Sharing and learning: TP6 project construction short record. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)