Problems with fastcgi php migration

Ian M. Evans ianevans at digitalhit.com
Wed Mar 12 12:17:51 MSK 2008


Igor Sysoev wrote:
> Then you try to remove cgi.fix-pathinfo and to use the following:

Okay, changed cgi.fix-pathinfo to cgi.fix-pathinfo=0 Restarted the 
fastcgi server, made the nginx changes and restarted.


>    location ~ ^/(galleries|poll|news)(/|$) {
> 
>        set  $script_name  $uri;
>        set  $path_info    "";
> 
>        if ($uri ~ ^(/[^/]+)(/.*)) {
>            set  $script_name  $uri;
>            set  $path_info    $1;
>        }
> 
>        fastcgi_pass ...
>        fastcgi_param  SCRIPT_FILENAME  $document_root$script_name;
>        fastcgi_param  PATH_INFO        $path_info;
>        ...
>    }
> 

That didn't work.

Firefox:
/galleries gave the application/octet stream download
/galleries/ gave a 404
/galleries/30/1/1 gave a 404

IE7:
/galleries displayed the PHP file
/galleries/ gave a 404
/galleries/30/1/1 gave a 404

Also, this appeared in the error log:
for /galleries/30/1/1:

[error] 13547#0: *59343 open() 
"/usr/local/apache/htdocs/galleries/30/1/1" failed (20: Not a directory)

for /galleries/
[error] 13578#0: *59589 "/usr/local/apache/htdocs/galleries/index.shtml" 
is not found (20: Not a directory)

So it appears that we were a bit closer with the previous email where 
cgi.fix-pathinfo was on and the only 404 was when there was a trailing 
slash after the filename.

Thanks.





More information about the nginx mailing list