Bug #99495
closedMemcache Cache Backend fatal Error when using memcache module
100%
Description
Note: There are 2 PHP-Modules for accessing memcache - [memcache](https://www.php.net/manual/en/book.memcache.php) and memcache*d*.
The documentation at https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/CachingFramework/FrontendsBackends/Index.html#memcached-backend
says:
There are two PHP memcached implementations: "memcache" and "memcached". Currently, only memcache is supported by this backend.
When attempting to use the MemcachedBackend with the PHP memcache module (not memecached), everything (frontend, backend, console-command) dies with:
Uncaught TYPO3 Exception Class "Memcached" not found
This is because of the code on line #132 of typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php :
$compressionFlag = $this->usedPeclModule === 'memcache' ? MEMCACHE_COMPRESSED : \Memcached::OPT_COMPRESSION;
which cannot be interpreted without Memcache*d* class existing (i.e. the memcache*d* module has been loaded).
1) MemcachedBackend only works with the Memcache*d* installed even though it appears to want to work with either Memcache or Memcache*d*
2) The documentation is not just out of date, but leads to installing the less advantages memcache module.
Updated by P Stern almost 2 years ago
- Subject changed from Memcache to Memcache Cache Backend fatal Error when using memcache module
- Complexity set to easy
Updated by P Stern over 1 year ago
- Target version set to next-patchlevel
The fix is a simple use of brackets in line #132 of typo3/sysext/core/Classes/Cache/Backend/MemcachedBackend.php
$compressionFlag = $this->usedPeclModule === 'memcache' ? MEMCACHE_COMPRESSED : (class_exists('Memcached') ? \Memcached::OPT_COMPRESSION : 0);
Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80378
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80378
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80378
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80387
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80388
Updated by Christian Spoo over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset eeb8680581374047e62fbaaba9a7f038a31a3f0c.