Bug #3029

Routing is not working correctly on all platforms

Added by Thomas Fritz over 12 years ago. Updated about 11 years ago.

Status:
Resolved
Priority:
Must have
Category:
MVC
Start date:
2009-04-03
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

I am getting this error when i request any URL with a path part (http://flow3.local/testing , http://flow3.local/testpackage ,...).

Warning: Unknown: Filename cannot be empty in Unknown on line 0

Fatal error: Unknown: Failed opening required '' (include_path='.:/usr/share/php5:usr/share/php') in Unknown on line 0

Platform:
Gentoo Linux. 2.6.27-gentoo-r7
Apache/2.2.10 (Unix) with mod_fcgid-2.2 NOT mod_fastcgi-2
PHP 5.3beta1 as CGI/FastCGI
cgi.fix_pathinfo=1 in php.ini

Possible Solution/Workaround:

This part is causing the problem. Change .htaccess from:

RewriteRule (.*) index.php/$1

to:

RewriteRule (.*) index.php

...and get the routing information from REQUEST_URI.
Change F3\FLOW3\Utility\Environment#201:

         public function getRequestURI() {
                 if (isset($this->SERVER['PATH_INFO'])) {
                         $requestURIString = $this->getRequestProtocol() . '://' . $this->getHTTPHost() . $this->SERVER['PATH_INFO'] . (strlen($this->SERVER['QUERY_STRING']) ? '?' . $this->SERVER['QUERY_STRING'] : '');
                 }
                 else if ($this->SERVER['REQUEST_URI']) {
                         $requestURIString = $this->getRequestProtocol(). '://' . $this->getHTTPHost() . $this->SERVER['REQUEST_URI'];
                 }
                 else {
                         $requestURIString = $this->getRequestProtocol() . '://' . $this->getHTTPHost() . '/';
                 }

                 $requestURI = new \F3\FLOW3\Property\DataType\URI($requestURIString);
                 return $requestURI;
         }


Files

FLOW3_3029.patch (732 Bytes) FLOW3_3029.patch Bastian Waidelich, 2009-05-25 15:10
FLOW3_Distribution_3029.patch (371 Bytes) FLOW3_Distribution_3029.patch patches .htaccess Bastian Waidelich, 2009-07-21 19:02
FLOW3_3029_v2.patch (788 Bytes) FLOW3_3029_v2.patch patches FLOW3/Classes/Utility/Environment.php Bastian Waidelich, 2009-07-21 19:02

Related issues

Related to TYPO3.Flow - Bug #3375: PATH_INFO is empty using fastcgi / WindowsResolvedKarsten Dambekalns2009-05-19

Actions

Also available in: Atom PDF