Incorrect request uri when routing through index.php

Discussion about the open-source Phalanger [?] project.

Incorrect request uri when routing through index.php

Postby johnc » March 25th, 2013, 3:42 am

As is pretty common among php developers our site is routing requests through index.php. URIs like /what/ever/thing are routed to /index.php/what/ever/thing and we use the $_SERVER['REQUEST_URI'] variable to then route the request to a controller.

When running under phalanger on a fastcgi server our request uri is simply "/index.php" for each and every request.

I've spent a while isolating this issue, our rewrite rules are solid (they are in production, unmodified, without phalanger) and our other fastcgi hosted projects don't seem to suffer from any bugs that might be in mono (though I wouldn't rule this out).

Any help would be appreciated. Thanks.
johnc
 
Posts: 45
Joined: March 24th, 2013, 9:17 pm

Re: Incorrect request uri when routing through index.php

Postby Jakub Misek » March 25th, 2013, 1:54 pm

Hi,

Phalanger does not run under fastcgi, so I just would like to ensure there is everything configured well. Phalanger is ASP.NET application, $_SERVER['REQUEST_URI'] variable is set directly by web server (mostly IIS).

Thanks,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Incorrect request uri when routing through index.php

Postby johnc » March 25th, 2013, 2:43 pm

Oh there's no way to have it work on fastcgi? Damn, Phalanger looks amazing and I was looking to get my wordpress sites running under it but all our servers are linux/lighttpd (we don't use apache).
johnc
 
Posts: 45
Joined: March 24th, 2013, 9:17 pm

Re: Incorrect request uri when routing through index.php

Postby Jakub Misek » March 25th, 2013, 2:53 pm

fastcgi isn't usable for .NET applications since they have slow startup and makes use of threads instead of processes.

Phalanger runs as ASP.NET application, so you just need something like aspnet_mono for your server. (enable aspnet thru mono on your server)
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Incorrect request uri when routing through index.php

Postby johnc » March 25th, 2013, 2:59 pm

Yes, we're using the mono fastcgi server to run asp.net apps. We've used it for a while and our other asp.net applications seem to be fine running under fastcgi.

To be clear, the fastcgi server comes with mono itself http://www.mono-project.com/FastCGI.
johnc
 
Posts: 45
Joined: March 24th, 2013, 9:17 pm

Re: Incorrect request uri when routing through index.php

Postby johnc » March 25th, 2013, 6:54 pm

Alright, I think I found what the problem is. The FastCGI host provided by mono is building an (incorrect) RawUrl property instead of honoring the REQUEST_URI parameter supplied by the webserver.

I'm going to write an update and submit a fork request to the XSP repo managed by mono but it may take a while to be accepted.
johnc
 
Posts: 45
Joined: March 24th, 2013, 9:17 pm

Re: Incorrect request uri when routing through index.php

Postby Jakub Misek » March 26th, 2013, 10:23 am

This seams to be the only solution ... if you post the work item id, we can try to speed it up.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 3 guests

cron

User Control Panel

Login

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 124 on September 25th, 2020, 6:57 am

Users browsing this forum: No registered users and 3 guests