下面簡單說明一下tp5運行在nginx上的配置。php
原文地址:小時刻我的博客>http://small.aiweimeng.top/index.php/archives/tp5_nginx.htmlhtml
tp5項目在nginx中默認是不支持pathinfo的,那麼咱們怎麼配置呢?nginx
先看下面的問題,咱們按照正常的流程配置好域名後,指向public目錄,重啓nginx,訪問時候路徑報錯,出現500。htm
解決辦法:blog
在fastcgi.conf文件裏面咱們會看到以下:get
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
咱們只須要修改open_basedir的路勁就能夠,修改以下:博客
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";
而後查看項目public文件夾下的```.user.ini```文件:
修改成:域名
open_basedir=/home/wwwroot/kilts/public:/tmp/:/proc/
而後稱其nginx,再打開項目就能夠正常運行。ast