Nginx PATH_INFO配置

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
リリース: 2016-06-06 20:21:42
オリジナル
1190 人が閲覧しました

我的配置现在是这样的

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

関連ラベル:
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
関連するチュートリアル
人気のおすすめ
最新のコース
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート