So it looks like running supercache on PHP 7 won't work. I got this back from support at Acquia:
Unfortunately, starting with PHP 7.0, APCu removed the option for full backwards compatibility with APC that existed with APCu in PHP 5.5 and 5.6. This means that PHP7 only accepts new APCu functions (for example apc_fetch()).
The best solution for the time being would be for your own modules or contrib modules to account for both (e.g. if apc_fetch() exists, use that, else apcu_fetch()). This of course would be true for all apc_* functions.
Not sure how to fix this or if there's work around ?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | supercache-php7-2833414-11819366.patch | 4.84 KB | caspervoogt |
Comments
Comment #2
caspervoogt commentedSee if this patch works for you. It at least does not cause errors on my end.
Comment #3
caspervoogt commentedComment #4
caspervoogt commentedI noticed an issue with Pathauto, seemingly caused by Supercache. I was experiencing the issue described here. I applied the patches there (to the dev version of Pathauto), yet that did not fix it. Then I uninstalled Supercache (the only module I played with recently), and the URL alias checkbox started behaving normally again. Just to be really sure, I then re-enabled Supercache to see if the regression would recur; it did. I also tested it with PHP 5.5.9 as well as PHP 7, and it happens in both cases.
I did go through the module some, and suspect the backend caching (ChainedFastBackend) is somehow to blame. I couldn't make much sense out of it all though.
I have had to uninstall Supercache for now.
Comment #5
swentel commentedThanks, will test it out next week. I'm 'lucky' I'm not using pathauto, so I can get away with it for now.
nitpick - spaces, o well :)
Comment #6
andypostBetter to move this checks to constructor to check only once
Comment #7
david_garcia commentedThe good approach to this is writting the code to target APCu exclusively and then use this to ensure backwards compatibility:
https://packagist.org/packages/symfony/polyfill-apcu
Indeed, if someone writes a code that targets APCu and support for old APC is dropped, I would not mind commiting that breaking change. After all the old APC is dead.
Comment #9
david_garcia commentedApproached and fixed using symfony's apcu pollyfill. Note that after this, if you are not using a build process for your Drupal 8 deployment, you should as the dependency is brought in through composer.json.