Issue with extension typo3_console due to not detected APCu module

474 views Asked by At

I've TYPO3 8 installation via Composer. I'm experiencing an issue with using extension typo3_console v5.3.0 from CLI. For the command:

./vendor/bin/typo3cms extension:activate realurl

I get following error:

[ TYPO3\CMS\Core\Cache\Exception ]                                                       
The PHP extension "apcu" must be installed and loaded in order to use the APCu backend. 

My OS is Ubuntu 16 with Apache. I do have APCu installed, v5.1.11 . It is added to my php.ini extension=apcu.so and I can see it's loaded when executing phpinfo(). Furthermore APCu is detected in TYPO3 Install Tool → Configuration Presets → Extbase Object Cache, thus I use if for back-end caching. Looks like so far everything is fine. Btw. apc.shm_size=16M

Any ideas why I get this this error?

ps. when I type php -m in CLI I can't see APCu on the list. Perhaps this exception is thrown due to not finding APCu in the output of that commend, dunno.

1

There are 1 answers

0
explorer On BEST ANSWER

Found a solution. PHP has a separate configuration file for CLI. APCu wasn't enable there..

You can find location of php.ini for CLI with this command:

php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"

In my case path to file is: /etc/php/7.2/cli/php.ini

assuming you already have installed APCu module, you need to enable access to it itself and access from CLI, basically those two lines of code:

extension=apcu.so
apc.enable_cli=On

After restarting Apache I was able to successfully execute commands like:

./vendor/bin/typo3cms extension:activate realurl