LinuxまたはWindowsでphpinfoモード機能を有効にするようにnginxを設定する方法

WBOY
リリース: 2023-05-17 11:31:23
転載
1214 人が閲覧しました

コードをコピーします コードは次のとおりです:

location ~ \.php(.*)$ {
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_indexindex.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_transrated $document_root$fastcgi_path_info;
# inc lude 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;
サーバー名 v.lzw.me;
インデックスindex.htmlindex.htmindex.phpdefault.htmldefault.htmdefault.php;
root /www/v .lzw.me;

# urlrewrite
include v.lzw.me.conf;

location ~ \.php(.*)$ {
fastcgi_pass unix:/tmp /php-cgi.sock;
fastcgi_indexindex.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_transrated $document_root $fastcgi_path_info;
#include fastcgi_params;
include fcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png| bmp|swf)$ {
有効期限は 30 時間;
}

location ~ .*\.(js|css)?$ {
有効期限は 12 時間;
}

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

その他のメソッド リファレンス (Windows 上の nginx などに適しています):

コードをコピーします。 コードは次のとおりです。

location ~ \.php
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_indexindex.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 スクリプトファイル名 $document_root $real_script_name;
fastcgi_param スクリプト名 $real_script_name;
fastcgi_param パス情報 $path_info;
}

以上がLinuxまたはWindowsでphpinfoモード機能を有効にするようにnginxを設定する方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

関連ラベル:
ソース:yisu.com
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
最新の問題
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!