• Resolved Zee

    (@laserjobs)


    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 6 years, 10 months ago by Zee.
Viewing 10 replies - 1 through 10 (of 10 total)
  • 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 it’s 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 “<!– Object Cache [total]……”

    Looks like ours states it is working in the Litespeed Cache admin panel but logs don’t show that it is.
    This isn’t present: “<!– Object Cache

    From the Logs:
    01/18/18 11:12:25.775 [65.78.76.218:63120 1 PtY] Object: connecting to /opt/memcached/run/INSTANCE/memcached-1.sock:0
    01/18/18 11:12:25.776 [65.78.76.218:63120 1 PtY] Object: failed to get persistent memcached server list!
    If we do use the UNIX version, is there a different setting we need to enable it?
    unix:///opt/memcached/run/INSTANCE/memcached-1.sock
    That’s what I pulled from our Cpanel and what was used in W3TC I believe…

    If this is a hosting issue (A2), please let us know too. Since we don’t get use of the crawler on a shared account, this may also be blocked unless we use Memcache thru W3TC (which I disabled).

    Thanks.
    Dave
    *Didn’t mean to take over this thread…

    Hello again,

    Put only “/opt/memcached/run/INSTANCE/memcached-1.sock” without unix prefix.

    That’s what I am using as I shared above.

    /opt/memcached/run/INSTANCENAME/memcached-1.sock

    I left the port zeroed out (nothing in that input field). I think if I entered it with the unix it either didn’t work OR you took it out for me ?? But while it says it’s working, I haven’t been able to confirm in my logs.

    Since my host seems to only support memcache in the past *if* you had W3TC installed, then I wonder if your plugin is able to keep it live and connected. Just a thought and my only apply to A2. Maybe you know if that’s the case…

    Dave

    Thread Starter Zee

    (@laserjobs)

    Cloudlinux PHP 7.2 Extensions adding memcached

    Hey (@hmsre)

    I’m 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.

    I’m on PHP 7.1 and with LSCache 1.8 with object cache disabled I’m getting an error

    Warning: Invalid argument supplied for foreach() in (...)/plugins/litespeed-cache/inc/object.class.php on line 222

    Plugin Support Hai Zheng?

    (@hailite)

    You don’t have a valid memcached connection. This warning will be removed in v1.8.1.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Object cache failed “Invalid argument supplied for foreach()”’ is closed to new replies.