首頁 > 運維 > Nginx > 主體

linux或windows下nginx開啟phpinfo模式功能怎麼配置

WBOY
發布: 2023-05-17 11:31:23
轉載
1214 人瀏覽過

複製程式碼 程式碼如下:

location ~ \.php(.*)$ {
 fastcgi_pass   unix:/tmp/php-cgi.sock;
 fastcgi_index  index.php;
 fastcgi_split_path_info ^(. \.php)(.*)$;
 fastcgi_param   script_filename $document_root$fastcgi_script_name;
  _param   path_info ument_root$fastcgi_path_info;
 #include        fastcgi_params;
 include fcgi.conf;
}

一個完整的網站設定範例:

複製程式碼 程式碼如下:

##log_format  v.lzw. me  '$remote_addr - $remote_user [$time_local] "$request" '

   '$status $body_bytes_sent "$http_referer" '

   '"$http_ _agent" $http_x_forwarded_for'; 80;
 server_name v.lzw.me;
 index index.html index.htm index.php default.html default.htm default.php;
 root  /www/v.lzw.me;

 # urlrewrite
 include v.lzw.me.conf;

# location ~ \.php(.*)$ {

  fastcgi_pass unix:/tmp/php-cgi.sock;
  fastcgi_index index.php;

  fastcgi_split_path_info ^(. \.php)(.*)$;

# fastcgi_param   script_filename _path_info;
  fastcgi_param   path_translated $document_root $fastcgi_path_info;
  #include        fastcgi_params;
  include fcgi.conf;
 }

 location ~ .*\$(Ujpg|jpeg. ##  expires 30d;
 }

 location ~ .*\.(js|css)?$ {

  expires 12h;

 }

 access_log  /wwwlogs/v .lzw.me.log  v.lzw.me;

}



其他方法參考(適合windows下的nginx等):

複製程式碼 程式碼如下:

location ~ \.php

{

 fastcgi_pass 127.0.0.1:9000;

 fastcgi_index index.php;

 include fcgi.conf;

 set $real_script_name $fastcgi_name_name $fastcgi_name_name # if ($fastcgi_script_name ~ "^(. ?\.php)(/. )$") {

  set $real_script_name $1;
  set $path_info $2;
 }
 fastcgi_param script_filename $docum $real_script_name;
 fastcgi_param script_name $real_script_name;
 fastcgi_param path_info $path_info;
}
#

以上是linux或windows下nginx開啟phpinfo模式功能怎麼配置的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:yisu.com
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!