下面thinkphp框架教程栏目将给大家分享一个thinkphp6 项目搭建小记录,希望对需要的朋友有所帮助!
thinkphp6 项目搭建记录
第一步:创建项目
composer create-project topthink/think "项目名称"
第二步:配置数据库链接
修改 .env 文件
[DATABASE]TYPE = mysqlHOSTNAME = 127.0.0.1DATABASE = 数据库USERNAME = 用户PASSWORD = 密码HOSTPORT = 3306CHARSET = utf8DEBUG = true
第三步:配置伪静态
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
nginx
location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; }}
推荐:《最新的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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version
Recommended: Win version, supports code prompts!

Atom editor mac version download
The most popular open source editor