寶塔部署thinkphp5報(bào)錯(cuò)的解決辦法:1、打開寶塔服務(wù)器,安裝php pathinfo擴(kuò)展并啟用;2、配置“.access”文件,內(nèi)容為“RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]”;3、在網(wǎng)站管理里面,啟用thinkphp的偽靜態(tài)即可。
本教程操作環(huán)境:Windows10系統(tǒng)、thinkphp5版、Dell G3電腦。
寶塔部署thinkphp5報(bào)錯(cuò)怎么辦?
寶塔服務(wù)器面板 部署 thinkphp5 坑
thinkphp5 在寶塔服務(wù)器上部署,出現(xiàn)的問題:
?
1. File not found.
原因: 寶塔服務(wù)器默認(rèn)不支持 pathinfo 的路徑訪問;需要在軟件 - PHP - 管理里面,安裝php pathinfo 擴(kuò)展,并啟用;
? ? ? ? ? ? ? ? ? ?thinkphp 在入口文件同級(jí)下,有個(gè) .access 文件,需要配置;官方文檔中有說明,但是有個(gè)地方是不正確的
? ? ? ? ? ? ? ? ? ?正確的配置應(yīng)該如下:
? ? ? ? ? ? ? ? ? ? ?
<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>
? ?特別注意? ?index.php?s=
這個(gè)問題搞了2天,糾結(jié)了好久。無意中嘗試發(fā)現(xiàn)是路徑的問題。太坑。
2.網(wǎng)站管理里面,需要啟用 thinkphp 的偽靜態(tài)。
?
完成上面2步,基本上能解決路徑不對(duì)的問題。? ?
?
路徑不對(duì),主要還是thinkphp的路由問題,可能版本不一樣,都會(huì)有所區(qū)別。需要具體視情況來分析了。
推薦學(xué)習(xí):《PHP視頻教程》《thinkPHP視頻教程》
? ??? Pagoda? thinkphp5? ??? ? ??? ???? ??? ?? ????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

? ????? Pagoda ?? ???? ??? ???? Pagoda? ??? ? server2022? ??? ? ? ?? ??? ?????. ??? ??? ????? ?????. ?? ??? ????? ????????!

Linux ???? ???? ???? ?? ???? ?????? ??? ????? ??? ? ???? ?? ?????. Ubuntu ?? ????? UFW ???? ???? ?? ??? ??? ? ????. ? ????? Pagoda ??? ???? UFW ???? ???? ??? ?????. 1??: Pagoda ?? ?? ?? Ubuntu? Pagoda ??? ???? ???. Pagoda ?? ?????? Pagoda Panel ?? ???? ??? ????? ? ????? ?? ??? ???? Pagoda Panel? ??? ? ????. $wget

Pagoda ??? Linux ????? ?? ??? ?? ?? ?????. ??? ??? ??? ?????? ??? ?? ???? ??? ?? ??? ? ????. Pagoda ??? ???? ???? ??? ???? ???? ???? ?? ?? ???? ??? ???? ?? ??? ????. ? ????? ?? ??? ??? ???? ?? Pagoda ??? ?? ?? ???? ?? ??? ???? ??? ?????. 1. ?? ?? ?? ?? ???? ??? ???? ???? ??? ???? ???? ??? ???? ??? ???? ?? ?????. ????

???? ??? ???? ?? ??? ??? ??? ???? ???? ? ? ??? ?????. ??? ?? ???? ??? ??? ?? ?? ??? ?? ??????? ????. ??? Pagoda ??? ???? ??? ?? ??? ???? ??? ???????. DNS? ?????? ??? ?? ??? ??? ??? ??? ???? ????? ??? IP ??? ????? ???????. ??? ?? ? ?? ??? ??? ???? ?? ? ?? IP ??? ???? ???????. ??? ?? ??? ?? ?? ??? ??? ?? ??, DNS ?? ? ?????.

Pagoda Panel? WebDAV ?? ?? ?? ?? WebDAV? HTTP ????? ???? ?? ?? ?? ???, ???? HTTP ????? ?? ???? ?? ??? ???? ??? ? ????. WebDAV ??? ???? ???? ???? ??? ???? ???? ??? ? ????. Pagoda Panel? WebDAV ?? ?? ?? ? ??? ??? ?? ??? ???? ?? ?? ? ?? ?? ?????. ??? ? ?

Pagoda? thinkphp5? ??? ? ??? ??? ?? ?? ??: 1. Pagoda ??? ?? php pathinfo ??? ???? ??????. 2. "RewriteRule ^(.*)$ index.php ???? ".access" ??? ?????. ?s=/$1 [QSA ,PT,L]”; 3. ???? ???? thinkphp? pseudo-static? ????? ???.

???? ????? ???? ?? ???? ?? ??? ???? ???, ?? ?? ???? ??? ?? ?? ??? ?? ???? ????. ??? ??? ??? ? ???? ??? ??? ?????, ??? ??? ???, ????? ? ?? ??? ??? ??? ? ????. ? ????? ??? ??? ?? ??? ?? Pagoda ??? ???? ??? ?????. 1. ??? ??? ??? ?????? ??? ??? ??? ??? ????? ??? ??? ??? ??? ???? ?? ?????. ?????? ??? ??? ???? ??? ??? ?? ???? ?? ?? ?????. ??? ??? ???.

Pagoda Panel? ??, ?? ? ??? ??, ?????? ?? ? ?? ?? ??? ??? ??? ???? ?? ???? ???? ??, ?? ? ?????? ? ??? ?? ??? ?? ????????. ??? ?? ??? MySQL ?????? ??? ?? ?? ??? ?????. ???? MySQL ??? ?? Pagoda ??? ???? ??? ?????? ???? ???? ???????. 1??: Pagoda ?? ?? MySQL ??? ?? Pagoda ??? ???? ?? ?? Pagoda ??? ???? ???.
