Since the APC extension is no longer maintained and has been superseded, the code can simply rely on the apcu_*() functions.
The last stable APC version has been releases on May, 2011, five years and a half before this issue was open.
Hopefully, no Drupal 7 site is still running on PHP 5. They are more probably running on PHP 7 or 8, with the APCu extension.
Since the APCUIterator class is only available starting from version 5.0.0, the minimum APCu version needs to be raised to 5.0.0.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | interdiff-8-6.txt | 19.39 KB | avpaderno |
| #8 | apcu-php7.patch | 11.83 KB | qqboy |
| #6 | 2846622-apcu-php7.patch | 10.07 KB | fgm |
Issue fork apc-2846622
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
A---- commentedAPCu for PHP7 (5.x) dropped the old APC compatibility.
You need to activate the
apcu_bc(for Backward Compabitility.) That may or may not work, I did not try it.Comment #3
Jorrit commentedMaybe the apc module can be change such that it doesn't need the backwards compatibility extension to be available.
Comment #4
fgmYou can just add this line above "// APCu reports cache ...."
It won't make the module work, but you'll no longer see it in the requirements screen, if that's what you're looking for.
Comment #5
fgmduplicate...
Comment #6
fgmSince I needed the plugin on PHP 7.0 without APCU-BC (Ubuntu Xenial 16.05 LTS), here is a port I did for the cache plugin.
I did not touch the requirements: the module doesn't need to be enabled to use the plugin anyway.
Comment #7
smitty commentedThis patch works really fine!
Comment #8
qqboy commentedhi a patch based upon 2846622-apcu-php7.patch.
Comment #9
smitty commentedHi qqboy, could you please report, what are the improvements of your patch compared to #6?
Comment #10
fgmMaybe an interdiff ?
Comment #11
izus commentedFWIW
#2 makes it and worked well
installing php-apcu-bc makes it green again :)
Thanks
Comment #12
tjharman commentedI'm not sure if I'm posting to the right thread or if I should start a new one, but I can't get this to work with
Drupal 8.9.2 and 7.3.19-1~deb10u1
I have installed both modules:
I have restarted php-fpm.
Still my Drupal Report tells me:
PHP APCu caching: Not enabled. PHP APCu caching can improve your site's performance considerably. It is highly recommended to have APCu installed on your server.
Do I have to add something to settings.php to get it to work?
Comment #13
avpadernoComment #14
avpadernoComment #15
avpadernoComment #16
avpadernoComment #17
avpadernoTo make the module compatible with APCu, also the code in
apc_requirements()must be changed.apc_requirements()cannot assume the APCu Backwards Compatibility Module extension is installed. That could be true most of the times, but it is not necessarily true.Comment #18
avpadernoAlso, since the APC extension is no longer maintained and has been superseded, the code can simply rely on the
apcu_*()functions.The last stable APC version has been releases on May, 2011, five years and a half before this issue was open.
Hopefully, no Drupal 7 site is still running on PHP 5. They are more probably running on PHP 7 or 8, with the APCu extension.
Comment #19
avpadernoComment #20
avpadernoComment #23
avpaderno