#78140Disable APCu on CLI, if it was added to LocalConfiguration.php automatically while installing TYPO3
Description
Problem/Description
I needed a few hours until I understood/find that a cacheConfiguration is added to LocalConfiguration (see below) if APCu is detected.
'caching' => [
'cacheConfigurations' => [
'extbase_object' => [
'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\ApcuBackend',
'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend',
'groups' => [
'system',
],
'options' => [
'defaultLifetime' => 0,
],
],
],
],
The big problem
There is no information or additional code added, which automatically disables APCu on CLI. If you are not deep into what APCu is or what TYPO3 do while installing the instance, you can freak out ;-)
After finishing the install wizard, the install tool DB Compare shows you
ALTER TABLE cf_extbase_object RENAME TO zzz_deleted_cf_extbase_object ALTER TABLE cf_extbase_object_tags RENAME TO zzz_deleted_cf_extbase_object_tags
which could also be very confusing.
—-
Acceptance Criteria
Possible scenario 1)
A TYPO3 integrator should get informed about what is added to LocalConfiguration automatically by the TYPO3 install process and what he has to do if he run CLI tasks/extbase command controllers.
Possible scenario 2)
An automatically added cacheConfiguration is automatically added to AdditionalConfiguration.php and wrapped into an if with a condition something like PHP_SAPI == 'cli' (or whatever is enough to fix CLI)
Possible scenario 3)
Such cache backends, which are known to not work in CLI mode must be disabled transparent.
Reviews 1
Related issues 1
History 1114
-
Gerrit Code Review pushed patch set 1 for master to change 50089 status
NewUnder Review <span data-processor="relativetime" data-value="2016-10-04T19:16:51+00:00" > 10/04/16, 19:16 </span> -
Josef Glatz changed description <span data-processor="relativetime" data-value="2016-10-30T06:18:49+00:00" > 10/30/16, 06:18 </span>
-
Josef Glatz changed description target version Sprint Focus Stabilization Sprint <span data-processor="relativetime" data-value="2017-02-17T21:31:58+00:00" > 02/17/17, 21:31 </span>
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2017-03-29T01:50:42+00:00" > 03/29/17, 01:50 </span>
-
David Henninger commented <span data-processor="relativetime" data-value="2017-05-09T09:54:21+00:00" > 05/09/17, 09:54 </span>
-
Josef Glatz commented <span data-processor="relativetime" data-value="2017-05-14T16:34:04+00:00" > 05/14/17, 16:34 </span>
Any updates or thoughts about this problem?
-
Josef Glatz commented and changed target version TYPO3 Version
89 <span data-processor="relativetime" data-value="2018-02-27T21:19:41+00:00" > 02/27/18, 21:19 </span>Problem still exists in 9.2-dev
-
Gerrit Code Review pushed patch set 2 for master to change 50089 <span data-processor="relativetime" data-value="2018-03-30T09:44:35+00:00" > 03/30/18, 09:44 </span>
-
Gerrit Code Review pushed patch set 3 for master to change 50089 <span data-processor="relativetime" data-value="2018-12-14T10:59:36+00:00" > 12/14/18, 10:59 </span>
-
Dirk Wenzel commented <span data-processor="relativetime" data-value="2019-01-16T13:18:32+00:00" > 01/16/19, 13:18 </span>
IMHO this solution should be available as bugfix for TYPO3 8 too.
-
Benni Mack changed Related to #82621 <span data-processor="relativetime" data-value="2020-03-23T16:04:23+00:00" > 03/23/20, 16:04 </span>
-
Josef Glatz changed status
Under ReviewNew <span data-processor="relativetime" data-value="2020-03-23T16:39:42+00:00" > 03/23/20, 16:39 </span> -
Benni Mack changed Sprint Focus
Stabilization Sprint<span data-processor="relativetime" data-value="2023-06-06T12:38:55+00:00" > 06/06/23, 12:38 </span> -
Georg Ringer commented and changed status
NewClosed <span data-processor="relativetime" data-value="2025-04-12T18:22:53+00:00" > 04/12/25, 18:22 </span>closing issue as apcu can also be enabled on CLI and I haven’t seen any issues in the last years here about the problem.
Once the APCu backend is enabled, the scheduler no longer works when called by PHP CLI, as Typo3 tries to use APCu, which is not available with CLI, causing the following error:
apc.enabled does not enable APCu for CLI and there isn’t a documented option to enable it either: https://secure.php.net/manual/en/apcu.configuration.php
However, the old option of its ancestor (apc.enable_cli) still works, however it is not recommend according to the old documentation: https://secure.php.net/manual/en/apc.configuration.php#ini.apc.enable-cli
Typo3 should not rely on APCu with PHP CLI as the parser.