我的配置现在是这样的
1 2 3 4 5 6 7 8 9 10 11 12 | <code>location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/ var /run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
</code>
|
ログイン後にコピー
ログイン後にコピー
怎么配置出$_SERVER['PATH_INFO']出来??
回复内容:
我的配置现在是这样的
1 2 3 4 5 6 7 8 9 10 11 12 | <code>location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/ var /run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
</code>
|
ログイン後にコピー
ログイン後にコピー
怎么配置出$_SERVER['PATH_INFO']出来??
location ~ \.php$ {
fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME /path/to/php$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <code>location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
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 ;
}
location / {
if (!-e $request_filename )
{
rewrite ^/xxxx/(.*)$ /xxx/index.php/ $1 last;
}
}</code>
|
ログイン後にコピー
看看这个把。
Nginx配置PATHINFO