Welcome! Log In Create A New Profile

Advanced

Re: Problem with fastcgi_split_path_info on ubuntu precise

B.R.
May 04, 2013 08:16PM
It seems that PATH_INFO is sensitive to points being used in URI...
Check the PHP doc about
$_SERVERhttp://www.php.net/manual/en/reserved.variables.server.php:
a very interesting example is being provided there.

Ubuntu is much likely not the problem.
Since you are a 'good sysadmin', you also tried to relate trouble to some
recent update of packages if any. :o)
If nothing changed in your setup or in your configuration, then it comes
from bad/unreliable usage of unknown resources.

Hope that I helped,
---
*B. R.*


On Sat, May 4, 2013 at 7:41 PM, zakaria <nginx-forum@nginx.us> wrote:

> Francis Daly Wrote:
> -------------------------------------------------------
> > On Fri, May 03, 2013 at 09:44:14PM -0400, zakaria wrote:
>
> > Hi there,
>
> > What output do you expect?
>
> > And if it not obvious: how does that differ from this output?
>
> > I *think* you're reporting that PATH_INFO is unexpectedly empty
> > in $_SERVER, in which case adding "fastcgi_param TEST_PATH_INFO
> > $fastcgi_path_info;" and retrying might give a hint as to where the
> > problem is.
>
> > f
> > --
> > Francis Daly francis@daoine.orgYes, that's what I mean.
>
> I'm sorry for being cryptic but this problem has me puzzled for two days.
>
> Let me tell the long story.
> I'm trying to setup a web server using nginx in ubuntu 12.04.2 (precise)
> Like any good sysadmin, I use bash script to setup everything.
> So I could replay it anytime.
>
> So on the friday I rerun the script (to enhanced it) and it didn't work
> like
> it used to.
> I swear, I got nginx working perfectly before with PATH_INFO and all.
>
> To answer your question. The PATH_INFO should output to '/foo/bar.php'
>
> Per your request here's my modified config
> ------------------------------------------------------------
> location ~ [^/]\.php(/|$) {
> fastcgi_split_path_info ^(.+?\.php)(/.*)$;
> fastcgi_param PATH_INFO $fastcgi_path_info;
> fastcgi_param TEST_PATH_INFO $fastcgi_path_info;
> try_files $fastcgi_script_name =404;
>
> fastcgi_pass unix:/var/run/php5-fpm.sock;
> fastcgi_index index.php;
> include fastcgi_params;
> }
> ------------------------------------------------------------
>
> And the result with cgi.fix_pathinfo = 1 (the default)
> ------------------------------------------------------------
> array (
> 'USER' => 'www-data',
> 'HOME' => '/var/www',
> 'FCGI_ROLE' => 'RESPONDER',
> 'PATH_INFO' => '',
> 'TEST_PATH_INFO' => '',
> 'QUERY_STRING' => '',
> 'REQUEST_METHOD' => 'GET',
> 'CONTENT_TYPE' => '',
> 'CONTENT_LENGTH' => '',
> 'SCRIPT_FILENAME' => '/var/www/test.php',
> 'SCRIPT_NAME' => '/test.php',
> 'REQUEST_URI' => '/test.php/foo/bar.php',
> 'DOCUMENT_URI' => '/test.php',
> 'DOCUMENT_ROOT' => '/var/www',
> 'SERVER_PROTOCOL' => 'HTTP/1.1',
> 'GATEWAY_INTERFACE' => 'CGI/1.1',
> 'SERVER_SOFTWARE' => 'nginx/1.4.0',
> 'REMOTE_ADDR' => '192.168.56.1',
> 'REMOTE_PORT' => '33683',
> 'SERVER_ADDR' => '192.168.56.3',
> 'SERVER_PORT' => '80',
> 'SERVER_NAME' => '',
> 'HTTPS' => '',
> 'REDIRECT_STATUS' => '200',
> 'HTTP_HOST' => 'lemp.test',
> 'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0)
> Gecko/20100101 Firefox/20.0',
> 'HTTP_ACCEPT' =>
> 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
> 'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.5',
> 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',
> 'HTTP_CONNECTION' => 'keep-alive',
> 'HTTP_CACHE_CONTROL' => 'max-age=0',
> 'PHP_SELF' => '/test.php',
> 'REQUEST_TIME' => 1367710298,
> )
> ------------------------------------------------------------
>
> So here's my request to you all:
> 1. Is my config correct? I'm sure it is.
> 2. Could you try it on your system and
> tell me whether the output differ from mine?
> 3. Is there something wrong on the latest ubuntu precise?
> Or is it just my imagination that I have it working before? :)
>
> Thanks,
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,238825,238849#msg-238849
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Problem with fastcgi_split_path_info on ubuntu precise

zakaria May 03, 2013 09:44PM

Re: Problem with fastcgi_split_path_info on ubuntu precise

GreenGecko May 03, 2013 09:56PM

Re: Problem with fastcgi_split_path_info on ubuntu precise

zakaria May 03, 2013 11:23PM

Re: Problem with fastcgi_split_path_info on ubuntu precise

Francis Daly May 04, 2013 07:58AM

Re: Problem with fastcgi_split_path_info on ubuntu precise

zakaria May 04, 2013 07:41PM

Re: Problem with fastcgi_split_path_info on ubuntu precise

B.R. May 04, 2013 08:16PM

Re: Problem with fastcgi_split_path_info on ubuntu precise

zakaria May 04, 2013 09:02PM

Re: Problem with fastcgi_split_path_info on ubuntu precise

Francis Daly May 05, 2013 04:00AM

Re: Problem with fastcgi_split_path_info on ubuntu precise

zakaria May 05, 2013 07:04AM

Re: Problem with fastcgi_split_path_info on ubuntu precise

Francis Daly May 07, 2013 04:38PM

Re: Problem with fastcgi_split_path_info on ubuntu precise

vilsack May 13, 2013 02:49PM

Re: Problem with fastcgi_split_path_info on ubuntu precise

Francis Daly May 14, 2013 05:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 54
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready