• Resolved authentico

    (@authentico)


    Hi, I have multiple sites running on seperate shared hosting accounts on Stablehost which runs LiteSpeed Servers.

    I had the Litespeed-Cache WP plugin + Object Cache (Memcached) working for a few months without issues, and this week I noticed Memcached can’t connect.

    PHP Version: 8.1.22
    Server API: LiteSpeed V8.1 Cloudlinux 1.3
    Memcached Version: 3.1.5
    libmemcached version: 1.0.18
    
    Status
    Memcached Extension: Enabled
    Redis Extension: Disabled
    Connection Test: Failed (Learn More)
    
    Host: localhost
    Port: 11211

    I went to Learn More and setup the Test file to connect to Memcached.

    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', 1);
    
    $m = new Memcached;
    $m->addServer('localhost', 11211);
    print_r($m->getServerList());
    
    echo '<hr>';
    
    $key = "test_key";
    $value = "Hello, Memcached!";
    $expiration = 3600;
    
    try {
        // Set value:
        $m->set($key, $value, $expiration);
        
        // Read value:
        if ($m->get($key)) {
            echo "Value successfully set in Memcached.";
        } else {
            echo "Failed to set value in Memcached.";
        }
    } catch (Exception $e) {
        echo "An error occurred: " . $e->getMessage();
    }

    Results:

    Array ( [0] => Array ( [host] => localhost [port] => 11211 [type] => TCP ) )
    Failed to set value in Memcached.
    
    • Connection seems to be established and returns a list that contains 1 server.
    • But when I expanded script with set/get, it fails to return the value, so seems that value isn’t being set.
    • PHP doesn’t throw any errors.

    I contacted Stablehost and asked them to restart the Memcached server, to which they told me (1) they can’t restart Memcached on a shared host, and (2) to contact the plugin creator.

    I said: that doesn’t make sense, because even without the plugin, I can’t connect to Memcached. To which they wasted my time by making me wait an hour saying “I’m looking into it”, and when I left, told me to contact the plugin creator.

    Do you have any idea what could be wrong?

    To me looks like Memcached is blocked/frozen and needs a restart, but I wanted to double-check with you.

    This isn’t even just one website, (1) it’s all my WordPress websites on this one shared account, and (2) I also manage a second account on Stablehost in WordPress + LiteSpeed-Cache and it has the same issue now. So it’s a cross-account problem at this point.

    It’s a Stablehost server issue, right?

    I tried using Redis and I’m getting the same issue there as well (I know it says Disabled here, but I only Enable either-or, turned it off after it wasn’t working).

    • This topic was modified 2 years, 9 months ago by authentico.
    • This topic was modified 2 years, 9 months ago by authentico.
    • This topic was modified 2 years, 9 months ago by authentico.
    • This topic was modified 2 years, 9 months ago by authentico.
    • This topic was modified 2 years, 9 months ago by authentico.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support qtwrk

    (@qtwrk)

    if that test script does not work , then it must be something wrong on the server-side , most likely the Memcached is not running or not working

    Thread Starter authentico

    (@authentico)

    Thanks, that validation makes me feel less like I’m crazy in thinking they didn’t do their job at Stablehost to investigate the issue with the server.

    • This reply was modified 2 years, 9 months ago by authentico.
    Plugin Support qtwrk

    (@qtwrk)

    well , I probably can not tell you where is problem , but I suppose I can tell you where the problem did not come from

    obvious that test script just a simpe PHP script , without involving cache plugin , so obviously , it must be something from the server ,

    if you have SSH access to server, can try telnet 127.0.0.1 11211 first , or maybe your Memcached was configured as unix socket mode , I have that on shared hosting , to isolate the data from other user

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Object Cache “Connection Test: Failed”’ is closed to new replies.