Issue Bug Closed

#97543Correctly resolve instance script path

Oliver Hader 05/03/22, 12:25 updated 10/04/22, 14:03

Description

Calling an URL like https://ip12.anyhost.it/index.php/invalid leads to various errors and side-effects, e.g.

# TYPO3 v12-dev
Fatal error: Uncaught RuntimeException: Could not create directory "vhosts/ip12.local/index.php/typo3temp/var/log/"!
in typo3/main/typo3/sysext/core/Classes/Utility/GeneralUtility.php:1788

# TYPO3 v11
Fatal error: Uncaught RuntimeException: Could not create directory "vhosts/ip11.local/index.php/typo3temp/var/log/"!
in typo3/branches/11.5/typo3/sysext/core/Classes/Utility/GeneralUtility.php:1948

# TYPO3 v10
Warning: require(vhosts/ip10.local/index.php/typo3/sysext/core/Configuration/DefaultConfiguration.php): failed to open stream: No such file or directory
in typo3/branches/10.4/typo3/sysext/core/Classes/Configuration/ConfigurationManager.php on line 92

This behavior seems to occur only on web-servers using Apache with PHP-CGI or PHP-FPM, using PHP setting cgi.fix_pathinfo = 1.

In this particular scenario, relevant $_SERVER properties were like the following:

  ["ORIG_PATH_TRANSLATED"]=>
  string(59) "/vhosts/ip12.local/index.php/invalid"
  ["PATH_TRANSLATED"]=>
  string(49) "/vhosts/ip12.local/invalid"
  ["ORIG_SCRIPT_FILENAME"]=>
  string(42) "/anything/apache2/fcgid/php81/wrapper"
  ["SCRIPT_FILENAME"]=>
  string(51) "/vhosts/ip12.local/index.php"

Reviews 3