- Magento Enterprise Edition 126.96.36.199
- PHP 7.2.15
- PECL memcached extension 3.1.3
We encountered this problem upgrading Magento EE from PHP 5.6 to PHP 7.2. We do not see the problem using the memcached 2.x extension with PHP 5.6, and do see the problem (100% reproducible) using the memcached 3.x extension with PHP 7.2 (no change to the memcache server itself).
The question: Has anyone actually SOLVED the problem for Magento EE?
The problem is fully described here: https://github.com/magento/magento2/issues/5319 but that issue was closed in 2016 without actually resolving the problem. The reporting person moved to Redis for session caching.
The people encountering this problem often ALSO encounter this problem: https://serverfault.com/questions/916129/php-7-2-failed-to-read-session-data-memcache - and reports therefore confuse the two. This latter problem has to do with PHP expecting the session handler to return a string, when actually false or null can be returned. Solve this one by casting the return value to string.
These reports for Magento 2 are almost certainly the same issue as this: Magento 2.2.2 Unable to clear session lock record in /var/www/magento/vendor/magento/framework/Session/SaveHandler/Native.php on line 22 and Magento 2: memcached error "SessionHandler::read(): Unable to clear session lock record in" .
This memcached extension issue https://github.com/php-memcached-dev/php-memcached/issues/399 remains open, but the ini-parameter tweaks suggested in that ticket haven't resolved our issue. That ticket references https://github.com/php-memcached-dev/php-memcached/issues/269 but none of the suggestions in the latter ticket have helped either.
All indications are that this is not specific to Magento or any version of Magento. It appears to be a known (and unresolved) problem with PHP 7.x using the PECL memcached extension 3.x. Reports linked above confirm that the problem isn't present when falling back to PHP 5.6 / memcached 2.x.
I'd like confirmation that this problem remains unsolved for Magento, or if solved, how to solve it (continuing to use memcached for session caching).