鍍金池/ 問答/PHP  Linux/ nginx 部署think3.2.3 nginx 不支持PATHINFO的問題

nginx 部署think3.2.3 nginx 不支持PATHINFO的問題

我是小白一枚.我用thinkphp開發(fā)網(wǎng)站.本地測試沒問題.但是上傳linux系統(tǒng)服務(wù)器Nginx.首頁可以打開.查了一堆資料.說是Nginx服務(wù)器不支持thinkphp的PATHINFO.我就把url模式改為2.Nginx.conf里面添加` location / {

     if (!-e $request_filename) {
     rewrite  ^(.*)$  /index.php?s=$1  last;
      break;
     }
     }`      結(jié)果就是網(wǎng)頁無法訪問....求解決辦法....
回答
編輯回答
何蘇葉

linux 不支持不支持PATHINFO 。解決方法是把thinkphp中的配置文件 中的 url模式改為2.

2017年5月21日 00:39
編輯回答
瘋子范

TP官網(wǎng)有詳細(xì)的解說

2018年7月4日 06:06
編輯回答
孤星

做一下pathinfo吧,或者換成apache

location ~ .*\.php
{
    fastcgi_param PATH_INFO $fastcgi_script_name;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_connect_timeout 300;
    fastcgi_read_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_buffer_size 64k;
    fastcgi_buffers   4 32k;
    fastcgi_busy_buffers_size 64k;
    fastcgi_temp_file_write_size 64k;
    include  fastcgi_params;
}
2018年5月5日 23:08
編輯回答
心癌

其實(shí)TP的官方文檔有說明,也可以參考這里

2018年1月25日 02:09
編輯回答
命于你
我的網(wǎng)站目錄是/zrrcms,也就是wwww.abc.com/zrrcms/
我在nginx.conf里面server {}加段這個(gè)
location /zrrcms/ {

   index index.php;

   if (!-e  $request_filename) {
                 
                  rewrite ^/zrrcms/(.*)$ /zrrcms/index.php?s=$1 last;
    }


 }
2018年6月28日 17:04