Issue Bug Closed

#76685CLI: Calculated absolute path to typo3/sysext is wrong if calling from CGI-context

Rene K 06/17/16, 18:29 updated 08/04/20, 10:07

Description

I have tried to execute the cli_dispatch.phpsh under PHP7 as CLI – it says that the calculated path cannot be found.

Indeed, SystemEnvironmentBuilder::getPathThisScriptCli() returns “/usr/local/bin/php”, not the path to the script because it relies to $_SERVER: argv or $_ENV:_ which were both not set in my environment.

The solution was to use another interpreter (php_cli instead of php).

Conclusion:
- getPathThisScriptCli() should throw a warning if $_SERVER:argv & $_ENV:_ are not set.
- Note that the index $_SERVER:PWD was also available, but it fails reading it because $isRelativePath was false.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.