Title: Object Cache Connection Test
Last modified: February 24, 2019

---

# Object Cache Connection Test

 *  Resolved [Mikey](https://wordpress.org/support/users/mikeyhash/)
 * (@mikeyhash)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/)
 * Hi,
 * The connection test appears as `Failed` for my Object Cache setting (Memcached).
   Please see [http://prntscr.com/mpdfl8](http://prntscr.com/mpdfl8)
 * I’ve read all the instructions in your official guidelines, but they beat me.
   I’m not a pro in this stuff and can’t really figure it out.
 * Can you please help on how to make it work?

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

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11242211)
 * Hi,
 * If you have SSH access, please try command `telnet 127.0.0.1 11211`
 * If you don’t have SSH access, please create a PHP file , with following code 
   and access it , see what is output ?
 *     ```
       <?php
       $mem = new Memcached();
       $mem->addServer("127.0.0.1", 11211);
       //$mem->connect("127.0.0.1", 11211);
       $mem->set('key1', 'This is first value', 60);
       $val = $mem->get('key1');
       echo "Get key1 value: " . $val ."<br />";
       $mem->replace('key1', 'This is replace value', 60);
       $val = $mem->get('key1');
       echo "Get key1 value: " . $val . "<br />";
       $arr = array('aaa', 'bbb', 'ccc', 'ddd');
       $mem->set('key2', $arr, 60);
       $val2 = $mem->get('key2');
       echo "Get key2 value: ";
       print_r($val2);
       echo "<br />";
       $mem->delete('key1');
       $val = $mem->get('key1');
       echo "Get key1 value: " . $val . "<br />";
       $mem->flush();
       $val2 = $mem->get('key2');
       echo "Get key2 value: ";
       print_r($val2);
       echo "<br />";
       $mem->close();
       ```
   
 * Best regards,
 *  Thread Starter [Mikey](https://wordpress.org/support/users/mikeyhash/)
 * (@mikeyhash)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11242308)
 * [@qtwrk](https://wordpress.org/support/users/qtwrk/), thank you for your response.
 * Can you please be more specific? Again, I’m not a php developer, although not
   a complete noob either.
 * As far as I’ve looked into it, it appears that I do not have SSH Access in my
   cpanel.
 * Thus, I’ve created the .php file containing your code above. But…what exactly
   do I have to do with it? Where do I save it and how do I access it?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11242319)
 * Hi,
 * If you are using cPanel:
 * 1. login cPanel , go to file manage
 * 2. in /public_html/ folder , create a new file , namely “test.php”
 * 3. copy the above code and save it
 * 4. access it by [https://your_domain/test.php](https://your_domain/test.php)
 * 5. paste the output of it.
 * Best regards,
 *  Thread Starter [Mikey](https://wordpress.org/support/users/mikeyhash/)
 * (@mikeyhash)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11242330)
 * Thank you.
 * The output:
 *     ```
       Get key1 value: 
       Get key1 value: 
       Get key2 value: 
       Get key1 value: 
       Get key2 value: 
       ```
   
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11242345)
 * Hi,
 * That means your server doesn’t have memcached
 * the object cache consisted by 2 parts.
 * 1. PHP extension , which is you see in LSCWP page what it says “enabled”, this
   is the middle-way-component that communicates between PHP and memcached backend
 * 2. the memcached daemon , where stores your objects.
 * Your server has part 1, but doesn’t have part 2.
 * You should contact your hosting provider and ask them if they provide memcached
   or not.
 * Best regards,
 *  Thread Starter [Mikey](https://wordpress.org/support/users/mikeyhash/)
 * (@mikeyhash)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11242546)
 * Ok, thank you. I will contact my hosting provider.
 *  Thread Starter [Mikey](https://wordpress.org/support/users/mikeyhash/)
 * (@mikeyhash)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11245659)
 * [@qtwrk](https://wordpress.org/support/users/qtwrk/), I have contacted my provider
   and they only use Redis, not Memcached.
 * With Redis, the connection seems to work, but I need to do a few more tests.
 * Can you please give me a similar .php snippet as to the previous one for Memcached,
   so I could test the output for Redis?
 * Thank you very much.
    -  This reply was modified 7 years, 3 months ago by [Mikey](https://wordpress.org/support/users/mikeyhash/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11246107)
 * Hi,
 * Just googled out [this one](https://www.tutorialspoint.com/redis/redis_php.htm)
 *     ```
       <?php 
          //Connecting to Redis server on localhost 
          $redis = new Redis(); 
          $redis->connect('127.0.0.1', 6379); 
          echo "Connection to server sucessfully"; 
          //check whether server is running or not 
          echo "Server is running: ".$redis->ping(); 
       ?>
       ```
   
 * you should see output as
 * _Connection to server sucessfullyServer is running: +PONG_
 * Best regards
 *  Thread Starter [Mikey](https://wordpress.org/support/users/mikeyhash/)
 * (@mikeyhash)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11247397)
 * [@qtwrk](https://wordpress.org/support/users/qtwrk/), thank you.
 * Please note that I have encountered a very big issue with Object Cache enabled:
   Users cannot add products to cart. Basically, you add a product and right after
   that it says “Your cart is empty” and thus you cannot complete an order.
 * When Object cache is disabled, everything goes back to normal.
 * Is there something I need to further configure in order to not have this issue?
   I can’t figure if there is some “wc cart object” to exclude in “Do Not Cache 
   Groups”.
    -  This reply was modified 7 years, 3 months ago by [Mikey](https://wordpress.org/support/users/mikeyhash/).
    -  This reply was modified 7 years, 3 months ago by [Mikey](https://wordpress.org/support/users/mikeyhash/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11254653)
 * Hi,
 * Could you please submit a ticket [here](https://store.litespeedtech.com/store/submitticket.php)?
   we will dig it deeper.
 * Please turn it off for the time being.
 * Best regards,
    -  This reply was modified 7 years, 3 months ago by [qtwrk](https://wordpress.org/support/users/qtwrk/).
 *  Thread Starter [Mikey](https://wordpress.org/support/users/mikeyhash/)
 * (@mikeyhash)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11322517)
 * Hi,
 * just wanted to let you know that I’ve submitted a ticket yesterday.
 * Thanks.
 *  [minhduc.dev](https://wordpress.org/support/users/ducpl/)
 * (@ducpl)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11368248)
 * Hello, I encountered the same error, when activating the “memcached” function
   my cart has not changed. When the “memcached” function is turned off, my cart
   works normally.

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

The topic ‘Object Cache Connection Test’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 12 replies
 * 3 participants
 * Last reply from: [minhduc.dev](https://wordpress.org/support/users/ducpl/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/object-cache-connection-test/#post-11368248)
 * Status: resolved