分享學習:TP6項目搭建小記錄

下面thinkphp框架教程欄目將給大家分享一個thinkphp6 項目搭建小記錄,希望對需要的朋友有所幫助!

分享學習:TP6項目搭建小記錄

thinkphp6 項目搭建記錄

第一步:創建項目

composer?create-project?topthink/think?"項目名稱"

第二步:配置數據庫鏈接

修改 .env 文件

[DATABASE]TYPE?=?mysqlHOSTNAME?=?127.0.0.1DATABASE?=?數據庫USERNAME?=?用戶PASSWORD?=?密碼HOSTPORT?=?3306CHARSET?=?utf8DEBUG?=?true

第三步:配置偽靜態

Apache

<ifmodule>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 END
喜歡就支持一下吧
點贊5 分享