Bug #3375

PATH_INFO is empty using fastcgi / Windows

Added by Robert Lemke over 12 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Must have
Category:
MVC
Start date:
2009-05-19
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

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

Related to TYPO3.Flow - Bug #3029: Routing is not working correctly on all platformsResolvedKarsten Dambekalns2009-04-03

Actions
#1

Updated by Robert Lemke over 12 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 over 12 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 over 12 years ago

  • Target version changed from 1.0 alpha 1 to 283
#4

Updated by Robert Lemke over 12 years ago

  • Priority changed from Should have to Must have
#5

Updated by Robert Lemke over 12 years ago

  • Target version deleted (283)
#6

Updated by Karsten Dambekalns almost 12 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 almost 12 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 11 years ago

  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Target version set to 1.0 alpha 8
#9

Updated by Karsten Dambekalns over 11 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r3833.

Also available in: Atom PDF