這篇文章主要介紹“l(fā)inux或windows下nginx開啟phpinfo模式功能怎么配置”,在日常操作中,相信很多人在linux或windows下nginx開啟phpinfo模式功能怎么配置問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”linux或windows下nginx開啟phpinfo模式功能怎么配置”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供辰溪網(wǎng)站建設、辰溪做網(wǎng)站、辰溪網(wǎng)站設計、辰溪網(wǎng)站制作等企業(yè)網(wǎng)站建設、網(wǎng)頁設計與制作、辰溪企業(yè)網(wǎng)站模板建站服務,10年辰溪做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡服務。
復制代碼 代碼如下:
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;
fastcgi_param path_info $fastcgi_path_info;
fastcgi_param path_translated $document_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_user_agent" $http_x_forwarded_for';
server {
listen 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 $document_root$fastcgi_script_name;
fastcgi_param path_info $fastcgi_path_info;
fastcgi_param path_translated $document_root$fastcgi_path_info;
#include fastcgi_params;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
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_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param script_filename $document_root$real_script_name;
fastcgi_param script_name $real_script_name;
fastcgi_param path_info $path_info;
}
到此,關于“l(fā)inux或windows下nginx開啟phpinfo模式功能怎么配置”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續(xù)學習更多相關知識,請繼續(xù)關注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
新聞名稱:linux或windows下nginx開啟phpinfo模式功能怎么配置
網(wǎng)站網(wǎng)址:http://weahome.cn/article/peeehi.html