Bug #3375
PATH_INFO is empty using fastcgi / Windows
Status: | Resolved | Start date: | 2009-05-19 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Karsten Dambekalns | % Done: | 100% |
|
Category: | MVC | |||
Target version: | TYPO3 Flow Base Distribution - 1.0 alpha 8 | |||
PHP Version: | Complexity: | |||
Has patch: | Affected Flow version: |
Description
During the T3DD09 someone said that some parts of the routing don't work properly when using fastcgi (on Windows?) because PATH_INFO is always empty on that platform.
Please verify this and check how it can be solved.
Related issues
Associated revisions
[+API] FLOW3 (Utility): Added detectBaseUri() to Environment. Given an URI instance it tries to detect the corresponding base URI.
[+API] FLOW3 (Utility): Added getScriptRequestPath() to Environment, returns the path to the actual script request relative to the document root.
[~API] FLOW3 (Utility): Renamed getScriptRequestPathAndName() to getScriptRequestPathAndFilename() in Environment.
[~TASK] FLOW3 (MVC): Reverted recent change by Robert related to request path handling, relates to #6596
[~TASK] FLOW3 (Utility): Some more changes to getRequestUri() in Environment, relates to #6596, relates to #3029, relates to #3375.
[~TASK] FLOW3 (Resource): Make use of new getScriptRequestPath() method in FileSystemPublishingTarget.
History
#1 Updated by Robert Lemke about 6 years ago
Another thing mentioned (don't know if it's related) was that routing fails if the URI contains a "%" sign.
#2 Updated by Karsten Dambekalns about 6 years ago
The % thingy could be worked around by using this
Index: Environment.php =================================================================== --- Environment.php (revision 2361) +++ Environment.php (working copy) @@ -200,7 +200,9 @@ * @author Robert Lemke <robert@typo3.org> */ public function getRequestURI() { - if (isset($this->SERVER['PATH_INFO'])) { + if (isset($this->SERVER['REQUEST_URI'])) { + $requestURIString = $this->getRequestProtocol() . '://' . $this->getHTTPHost() . $this->SERVER['REQUEST_URI'] . (strlen($this->SERVER['QUERY_STRING']) ? '?' . $this->SERVER['QUERY_STRING'] : ''); + } elseif (isset($this->SERVER['PATH_INFO'])) { $requestURIString = $this->getRequestProtocol() . '://' . $this->getHTTPHost() . $this->SERVER['PATH_INFO'] . (strlen($this->SERVER['QUERY_STRING']) ? '?' . $this->SERVER['QUERY_STRING'] : ''); } else { $requestURIString = $this->getRequestProtocol() . '://' . $this->getHTTPHost() . '/';
Needs more checking, though...
#3 Updated by Robert Lemke about 6 years ago
- Target version changed from 1.0 alpha 1 to 283
#4 Updated by Robert Lemke about 6 years ago
- Priority changed from Should have to Must have
#5 Updated by Robert Lemke about 6 years ago
- Target version deleted (
283)
#6 Updated by Karsten Dambekalns over 5 years ago
From Marco Weber:
As far as i know there was a bug in PHP 5 with an empty PATH_INFO. But i think this bug depends on the configuration of "cgi.fix_path_info" in the php.ini. But this bug got fixed some time ago and shouldn't be in PHP5.3
My adivce would be to use REQUEST_URI on apache. In my experience it is the most reliable way. I've heard that there is no REQUEST_URI on IIS. ( Don't know what to use there... )
#7 Updated by Marco Weber over 5 years ago
here is the link to the fixed BUG, that i was talking about:
http://bugs.php.net/bug.php?id=31892
#8 Updated by Karsten Dambekalns over 5 years ago
- Status changed from New to Accepted
- Assigned To set to Karsten Dambekalns
- Target version set to 1.0 alpha 8
#9 Updated by Karsten Dambekalns over 5 years ago
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100
Applied in changeset r3833.