0

I have upgraded our Docker images from PHP7.4 to PHP8 and now I am getting this error on every request:

APCuIterator::__construct(): Regular expressions support is not enabled, please enable PCRE for APCuIterator regex support.

We are using Symfony and it is making the call to new APCuIterator(). To reproduce this in isolation, I enabled apcu for CLI and then just invoked the constructor myself:

$ vim /etc/php/8.0/mods-available/apcu.ini
apc.enable_cli=1


$ php -a
Interactive mode enabled

php > new APCuIterator('whatever');
PHP Fatal error:  APCuIterator::__construct(): Regular expressions support is not enabled, please enable PCRE for APCuIterator regex support. in php shell code on line 1

PCRE is enabled though, preg_match() works without problems.


Disabling APCu seems to fix the problem, but that's not a "solution":

# /etc/php/8.0/mods-available/apcu.ini

# extension=apcu.so  <-- comment this out

I am baffled as there is literally no match of this error message on Google.

4

1 回答 1

0

原来这是一个版本问题。5.1.17我安装的APCu失败了。

升级到 APCu5.1.20修复了它。

于 2021-07-14T13:12:43.800 回答