Object cache failed Invalid argument supplied for foreach()




Wordpress LScache Plugin: Object cache failed Invalid argument supplied for foreach()

Last Updated on: Wed, 15 Apr 2026 00:00:02
Enabled memcached in php 7.2 Status Memcached Extension: Enabled Connection Test: Failed Warning: Invalid argument supplied for foreach() in /home/xxxxxxxx/wp-content/plugins/litespeed-cache/inc/object.class.php on line 222 Warning disappears if I disable Memcached otherwise it is there if object cache is disabled or enabled. This topic was modified 4 years, 10 months ago by Zee. I noticed the same. For ours, I enabled memcache via our CPANEL (shared hosting with A2Hosting) and replaced the following and it works (I think). Our host installs W3TC automatically to enable it but after turning it on (enable) then deactivating the W3TC? and changing these settings in LiteSpeed Cache, it works. Host: (Old) Localhost Host: (New) /opt/memcached/run/INSTANCENAME/memcached-1.sock Can someone check ours to make sure its working: HMSRE Hope that works/helps. Hello, @laserjobs ? check if your hosting is using tcp or unix memcached. @hmsre ? enable debug and in the source code of your page you have to see at the end Looks like ours states it is working in the Litespeed Cache admin panel but logs dont show that it is. This isnt present: Cloudlinux PHP 7.2 Extensions adding memcached Hey (@hmsre) Im on A2 shared hosting too, be great to know if you found a way to get this working please. i tried adding the string you mentioned in Host? /opt/memcached/run/INSTANCENAME/memcached-1.sock Do i need to change the INSTANCENAME to something else please? And what port number did you use? Thanks Hello again, Please contact your hosting provider to ask him if you have to change that INSTANCENAME . Hello. Im on PHP 7.1 and with LSCache 1.8 with object cache disabled Im getting an error Warning: Invalid argument supplied for foreach() in (...)/plugins/litespeed-cache/inc/object.class.php on line 222 You dont have a valid memcached connection. This warning will be removed in v1.8.1.



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference