# Php\_info - fastcgi\_split\_path\_info - Not does not work

**URL:** <https://www.ruby-forum.com/t/php-info-fastcgi-split-path-info-not-does-not-work/213042>\
**Category:** NGINX\
**Created:** [October 21, 2011, 2:13pm UTC](https://www.ruby-forum.com/t/php-info-fastcgi-split-path-info-not-does-not-work/213042 "2011-10-21T14:13:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 21, 2011, 2:13pm UTC](https://www.ruby-forum.com/t/php-info-fastcgi-split-path-info-not-does-not-work/213042/1 "2011-10-21T14:13:10Z")

</div>

I am having trouble setting the PATH\_INFO

I want accessing thus:  
[http://www.examples.com/test.php/images/test/000001](http://www.examples.com/test.php/images/test/000001)

LOGS  
2011/10/20 15:54:51 [error] 76110#0: \*1 open()  
“/var/www1/examples.com/test.php/dddd/eeee” failed (20: Not a  
directory), client: 200.12.10.92, server: [examples.com](http://examples.com), request: “GET  
/test.php/dddd/eeee HTTP/1.1”, host: “[www.examples.com](http://www.examples.com)”

## nginx.conf

user www;  
worker\_processes 4;  
worker\_rlimit\_nofile 8192;  
error\_log /var/log/nginx/error.log;  
pid /var/run/nginx.pid;  
events {  
worker\_connections 4096;  
}  
http {  
default\_type application/octet-stream;  
log\_format main '$remote\_addr - $remote\_user [$time\_local]  
$status ’  
'“$request” $body\_bytes\_sent “$http\_referer” ’  
‘“$http\_user\_agent” “$http\_x\_forwarded\_for”’;

```
    access_log /var/log/nginx/access.log main;
    sendfile on;
    tcp_nopush on;
    keepalive_timeout 35;
    tcp_nodelay on;
    server_names_hash_bucket_size 128;
    gzip on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";

```

server {  
listen 80;  
server\_name [examples.com](http://examples.com) [www.examples.com](http://www.examples.com);  
access\_log /var/log/nginx/examples.com-access.log main;  
error\_log /var/log/nginx/examples.com-error.log;

```
      root /var/www1/examples.com;
      index index.php index.html index.htm;

      location /nginx_status {
              stub_status on;
              access_log off;
              allow 127.0.0.1;
              deny all;
      }

      location ~ ^.+\.php$ {
              include fastcgi_params;
              fastcgi_intercept_errors on;
              fastcgi_pass unix:/tmp/php.socket;
      }

```

}  
}

## fastcgi\_params

fastcgi\_split\_path\_info ^(.+.php)(/.+)$;  
fastcgi\_param PATH\_INFO $fastcgi\_path\_info;  
fastcgi\_param PATH\_TRANSLATED $document\_root$fastcgi\_path\_info;  
fastcgi\_param SCRIPT\_FILENAME $document\_root$fastcgi\_script\_name;

fastcgi\_param QUERY\_STRING $query\_string;  
fastcgi\_param REQUEST\_METHOD $request\_method;  
fastcgi\_param CONTENT\_TYPE $content\_type;  
fastcgi\_param CONTENT\_LENGTH $content\_length;

fastcgi\_param SCRIPT\_NAME $fastcgi\_script\_name;  
fastcgi\_param REQUEST\_URI $request\_uri;  
fastcgi\_param DOCUMENT\_URI $document\_uri;  
fastcgi\_param DOCUMENT\_ROOT $document\_root;  
fastcgi\_param SERVER\_PROTOCOL $server\_protocol;

fastcgi\_param GATEWAY\_INTERFACE CGI/1.1;  
fastcgi\_param SERVER\_SOFTWARE nginx/1.0.8;

fastcgi\_param REMOTE\_ADDR $remote\_addr;  
fastcgi\_param REMOTE\_PORT $remote\_port;  
fastcgi\_param SERVER\_ADDR $server\_addr;  
fastcgi\_param SERVER\_PORT $server\_port;  
fastcgi\_param SERVER\_NAME $server\_name;

fastcgi\_index index.php;

# PHP only, required if PHP was built with --enable-force-cgi-redirect

fastcgi\_param REDIRECT\_STATUS 200;

---

<div class="post-metadata">

**Author:** ![edisoti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b9e5f3/32.png) [@edisoti](https://www.ruby-forum.com/u/edisoti)\
**Post date:** [October 21, 2011, 3:15pm UTC](https://www.ruby-forum.com/t/php-info-fastcgi-split-path-info-not-does-not-work/213042/2 "2011-10-21T15:15:17Z")

</div>

On Fri, Oct 21, 2011 at 08:12:41AM -0400, edisoti wrote:

Hi there,

> I am having trouble setting the PATH\_INFO
> 
> I want accessing thus:  
> [http://www.examples.com/test.php/images/test/000001](http://www.examples.com/test.php/images/test/000001)

The “location” here is /test.php/images/test/000001

> ```
> location /nginx_status {
> 
> ```

It doesn’t match that one.

> ```
> location ~ ^.+\.php$ {
> 
> ```

It doesn’t match that one.

So fastcgi\_split\_path\_info is not used.

As a short-term test, to confirm that the directives act as you expect,  
change this location definition to

location ~ php

Then when you are happy that you understand what everything is doing,  
change it to something that is right for your environment.

(Perhaps some variation on “.php($|/)” will be right for you; or  
perhaps  
nesting it inside a non-regex location.)

Good luck,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
