Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6189601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:26:27+00:00 2026-05-24T02:26:27+00:00

I’m experiencing a serious problem when I’m trying to use the Memcached caching driver

  • 0

I’m experiencing a serious problem when I’m trying to use the Memcached caching driver in Codeigniter. However, I cannot autoload the cache driver in this array:

$autoload['libraries'] = array('database', 'session', 'parser', 'common', 'cache');

If I remove the cache, the page loads, but if not the page shows blank with no error reporting (note, I have error reporting on and set to E_ALL).

Anyway, since I cannot load the cache, I added it to my created class common, and load it from there doing this:

class Common extends CI_Controller {

    function __construct()
    {
        parent::__construct();

        $this->load->driver('cache');
    }
}

Now I’m getting in errors:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Add::$cache

Filename: controllers/add.php

Line Number: 33 A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: controllers/add.php

Line Number: 33

Which add.php is this:

class Add extends CI_Controller {

    public function index()
    {
        $data = array('page_title' => 'Add your listing');

        $this->load->view('overall_header', $data);

        $sql = "SELECT item_id,
                       item_name
                FROM " . ITEMS_TABLE . "
                WHERE item_visible = 1";

        $items_key = md5('query:' . $sql);

        $result = $this->cache->memcached->save($items_key); // this is line 33
    }
}

I need memcached to work for my Codeigniter application, I’ve tried using this custom made class from github.

How can I get memcached to work, I have all the settings in the application/config/memcached.php properly set, but I guess that’s not the problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:26:29+00:00Added an answer on May 24, 2026 at 2:26 am

    First of all make sure PHP has the memcached library loaded. PHP uses two type of library: memcache and memcached (note the D at the end). Codeigniter cache driver needs the memcached extension.

    This driver is quite buggy. First, the default options are not loaded correctly so you need to make a config/memcached.php file

    This is how my config/memcached.php looks:

    <?php
    $config['memcached'] = array(
            'hostname'  => '127.0.0.1',
            'port'      => 11211,
            'weight'    => 1
    );
    

    In my controller/model I load the driver in this way:

    $this->load->driver('cache', array('adapter' => 'memcached', 'backup' => 'dummy'));

    So if memcached is not available, a dummy driver is loaded as fallback.

    Take care that the current stable release of CodeIgniter (2.0.2) has another bug in the driver loader class. Here the patch I applied

    After this fixes I got the driver working

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.