Re: Best way to deal with $_SERVER['REQUEST_URI'] on IIS?
| From: | Mattias Thorslund | Date: | Tue, 21 Apr 2009 20:21:27 +0000 |
| Subject: | Re: Best way to deal with $_SERVER['REQUEST_URI'] on IIS? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-291774@lists.php.net to get a copy of this message | ||
Andrew Ballard wrote:
On Tue, Apr 21, 2009 at 4:04 PM, Mattias Thorslund <mattias@thorslund.us> wrote:Thanks Andrew. I just read that there is supposedly a fix for this in FastCGI: http://ruslany.net/2008/08/update-for-iis-70-fastcgi-module/ You might have that update already. If this fix works, then it's obviously the best solution to the problem. Cheers, MattiasHi all, Apparently, $_SERVER['REQUEST_URI'] doesn't get set the same way when running PHP on IIS as when running it on Apache. Specifically, it seems to contain the script name only, and not the query string part. I know I can rewrite my code to piece together a $_SERVER['REQUEST_URI'] from $_SERVER['SCRIPT_NAME'] and $_SERVER['QUERY_STRING'], but some instances of $_SERVER['REQUEST_URI'] are in third party scripts which would be a bit of a pain to fix every time they are updated. It is a known problem since there are several mentions and workarounds to be found on the Internet, but I'm wondering which is currently the "best" way to deal with it. I don't personally run PHP with IIS, so I haven't encountered this problem before...but now I have a user who does. I could potentially have more users who encounter the same thing, so the easier the instructions and the less tinkering, the better. Is there a php.ini setting, for instance? What have you found that works for you? Thanks, MattiasIt works just fine on the servers where I work. Andrew