Issue Feature Closed

#98452Allow to disable CLI check by configuration

Jonas Wolf 09/27/22, 16:27 updated 03/30/25, 20:36

Description

There should be a configuration option to disable the CLI check found in \TYPO3\CMS\Core\Console\CommandApplication->checkEnvironmentOrDie()
(https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Console/CommandApplication.php#L165)

Reason: Some hosters (e.g. Strato) supply PHP binaries that report a SAPI other than “cli” even when called from a command line. In these environments, the CLI currently can’t be used at all.

If there is no technical reason why this check is necessary, administrators should be able to chose whether to have the check in place or not.

Reviews 0

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

History 1

  1. Stefan Bürk commented and changed status New Closed assigned to Stefan Bürk <span data-processor="relativetime" data-value="2025-03-30T20:36:31+00:00" > 03/30/25, 20:36 </span>

    Removing this check is not reasonable, and it provides a needed
    guard.

    TYPO3 has quite some places dealing with the SAPI and doing different
    things based on that, for exaple path calculations and other things.
    Also extensions may relay on this check.

    It’s common practice to differ between cli and web-context based on
    checking for the `cli` sapi, because there a dozen different possilbe
    web sapi’s.

    Nearly all reliable web hosting provider have proper cli binary/binaries
    available in ther offerings nower days (at least since a decade or more)
    and is a expectabe requirement.

    It the account really does not provide a correct cli-sapi binary that
    offering, host or partner should not be used for TYPO3 (or any other
    modern framework, cms or application).

    I don’t know strato personally, but the majority of providers having
    multiple php binaries available in cli (ssh/terminal) has a correct
    cli binary, in some cases suffixed with `-cli` or `_cli`.

    php -> fcgi binary
    php_cli -> cli binary
    php8.2 -> fcgi binary PHP8.2
    php_cli8.2 -> cli binary PHP 8.2

    or similar. Please refere to the documentation for that server/account/provider
    or contact the support which is the correct cli binary and run the TYPO3 cli
    command (or composer) with the correct php cli binary.

    We will not remove that check or make it skipable because of the aforementioned
    impact at leater points and based on the fact that it is expectable to be called
    with a correct cli binaries, which is nothing special, rare or ordinary today.

    Closing this issue now in hope the commented reasong is okay. If you think this
    should be further discussed, feel free to request reopening of the issue or contact
    me or other community members or core team members in the TYPO3 slack core dev channel
    to discuss this.