Sharing and learning: TP6 project construction short record
tp6
下面thinkphp框架教程栏目将给大家分享一个thinkphp6 项目搭建小记录,希望对需要的朋友有所帮助!
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
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
What's New in Windows 11 KB5054979 & How to Fix Update Issues
3 weeks ago
By DDD
How to fix KB5055523 fails to install in Windows 11?
2 weeks ago
By DDD
InZoi: How To Apply To School And University
4 weeks ago
By DDD
How to fix KB5055518 fails to install in Windows 10?
2 weeks ago
By DDD
Roblox: Dead Rails – How To Summon And Defeat Nikola Tesla
4 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
