Salin kod Kod adalah seperti berikut:
lokasi ~ .php(.*)$ {
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+.php)(.*)$;
nama_fail_skrip_fastcgi_param $document_root$fastcgi_script_name;
fastcgi_param path_info $fastcgi_path_info;
$fastcgi_path_info;
$fastcgi_path_info ;
# sertakan fastcgi_params;
sertakan 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'; dengar 80 ;
nama_server v.lzw.me;
indeks index.html index.htm index.php default.html default.htm default.php;
root /www/v. lzw.me;
# urlrewrite
sertakan v.lzw.me.conf;
lokasi ~ .php(.*)$ {
fastcgi_pass unix:/tmp/php -cgi.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+.php)(.*)$;
nama fail_fail_fail_fastcgi_param $document_root$fastcgi_script_name;
laluan_fastcgi_param_fastcgi > cgi_param path_translated $document_root$fastcgi_path_info ;
#include fastcgi_params;
include fcgi.conf;
}
tamat tempoh 30h;
}
tamat tempoh 12j;
}
}
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
sertakan fcgi.conf;
tetapkan $nama_skrip_sebenar $nama_skrip_sebenar;
jika ($nama_skrip_fastcgi ~ "^(.+?.php)(/.+)$") {
tetapkan $nama_skrip_sebenar $1;
tetapkan $path_info $2;
}
nama_fail_skrip_fastcgi_param $document_root$nama_skrip_sebenar;
nama_skrip_fastcgi_param $nama_skrip_sebenar;
fastcgi_param path_info $path_info;
}
Atas ialah kandungan terperinci Bagaimana untuk membolehkan fungsi mod phpinfo dalam nginx di bawah linux/windows. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!