Welcome! Log In Create A New Profile

Advanced

Handling /foo.php/bar script URLs

Posted by jhilgeman 
Handling /foo.php/bar script URLs
November 15, 2009 06:08PM
Just migrated from Apache to 0.8.22 with FastCGI PHP (php-fpm). I've been trying to get this working for a while now, but keep running into problems. I'm trying to install PHP Gallery 3, which uses URLs like /gallery3/index.php/combined/javascript/blah.js.

The error log reports: (20: Not a directory)

My config looks like this:

[code]
server
{
......

location / {
index index.html index.htm index.php;
}

location /gallery3/index.php {
fastcgi_split_path_info ^(/gallery3/index\.php)(.*)$;
root /web/domainhere.com/htdocs;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;

include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $http_host;
fastcgi_ignore_client_abort on;
}
}
[/code]

When i add the fastcgi_split_path_info line, it DOES properly pass index.php to PHP to be processed, but it seems like nothing else gets passed, so the resulting file is as if I simply called /gallery3/index.php without any query string parameters. Can't find any solutions on Google or in the wiki - can someone help? Thank you!
Re: Handling /foo.php/bar script URLs
November 15, 2009 06:16PM
It always seems like as soon as I give up and post a question, I find the answer. By adding the PATH_INFO parameter into my config, it seemed to work (I also tried adding in PATH_TRANSLATED but that didn't work, so I commented it out). Here's the adjusted config piece:
[code]
location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
# x\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
#fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

root /web/...../htdocs;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;

include fastcgi_params;
fastcgi_param SERVER_NAME $http_host;
fastcgi_ignore_client_abort on;
}
[/code]
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 77
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