一.首頁404未找到 檢查項目配置是否配置好
解決地址:phpstudy網(wǎng)站或站點創(chuàng)建成功,打開無響應(yīng)_php打開提示站點創(chuàng)建成功_荒-漠的博客-CSDN博客
二.vendor目錄不存在? composer未安裝
解決地址:laravel安裝composer依賴_荒-漠的博客-CSDN博客?文章來源:http://www.zghlxwxcb.cn/news/detail-633394.html
?三.首頁可以展示 里面路徑404 未配置偽靜態(tài)
apche解決辦法:
phpstudy站點404訪問遭到拒絕 首頁可以訪問 接口不能訪問_phpstudy報錯404_荒-漠的博客-CSDN博客文章來源地址http://www.zghlxwxcb.cn/news/detail-633394.html
nginx解決辦法:
Nginx是一個高性能的Web服務(wù)器和反向代理服務(wù)器,可以通過配置偽靜態(tài)規(guī)則來對URL進行重寫,實現(xiàn)偽靜態(tài)。 下面是針對ThinkPHP的一些常見的Nginx偽靜態(tài)規(guī)則: 1. 去掉index.php ``` location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; } } ``` 這個規(guī)則會將所有請求重寫到index.php文件中,去掉URL中的index.php。 2. 重寫URL中的參數(shù) ``` location / { if (!-e $request_filename) { rewrite ^/(.*)/(.*)$ /index.php/$1/$2 last; break; } } ``` 這個規(guī)則會將URL中的參數(shù)重寫到index.php文件中,例如將http://example.com/index.php?m=home&c=index&a=index重寫為http://example.com/home/index/index。 3. 重寫URL中的控制器和操作方法 ``` location / { if (!-e $request_filename) { rewrite ^/([a-zA-Z]+)/([a-zA-Z]+)/([a-zA-Z]+)$ /index.php?m=$1&c=$2&a=$3 last; break; } } ``` 這個規(guī)則會將URL中的控制器和操作方法重寫到index.php文件中,例如將http://example.com/index.php?m=home&c=index&a=index重寫為http://example.com/home/index/index。 4. 添加后綴名 ``` location / { if (!-e $request_filename) { rewrite ^/(.*)$ /$1.html last; break; } } ``` 這個規(guī)則會將URL添加后綴名,例如將http://example.com/index.php?m=home&c=index&a=index重寫為http://example.com/index.html。 以上是一些常見的Nginx偽靜態(tài)規(guī)則,可以根據(jù)實際情況進行調(diào)整和修改。
到了這里,關(guān)于laravel項目運行問題記錄的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!