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 8674333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:41:05+00:00 2026-06-12T19:41:05+00:00

I have configured APC Cache for YII application but when I put a variable

  • 0

I have configured APC Cache for YII application but when I put a variable in cache, I get the following error for line 222:

APC Cache Error

https://i.stack.imgur.com/qu2tI.jpg

Following is my config/main.php entry for APC Cache:

        'cache'=>array(
            'class'=>'system.caching.CApcCache',
            'servers'=>array(
                    array('host'=>'localhost','port'=>11211,'weight'=>60),
                    array('host'=>'localhost','port'=>11212,'weight'=>40),
                ),
    ),

Following is the code that I use to put data in cache:

    public function getReligion(){
    $lstofvals=Yii::app()->cache->get('RELIGION');
    if ($lstofvals===false){
        Yii::log('Loading Religion Data from List of Values.');
        $lstofvals=$this->PopulateLSTValsData('RELIGION');
        Yii::app()->cache->set('RELIGION', $lstofvals);
    }
    return $lstofvals;
}

I can see the output of apc.php in form of graphs and all other details.

Any help would much appreciated.

Please also confirm if my strategy to store the base data in cache is correct. I am new to Yii and found out about MemCache and APC Cache to be good candidates for such requirements.

Many thanks,
Faisal

  • 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-06-12T19:41:08+00:00Added an answer on June 12, 2026 at 7:41 pm

    Remove the entire servers array from your config file. APC isnt distributed. Servers are used for memcache as far as I know

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

Sidebar

Related Questions

I have configured Plone with the following buildout (via http://build.pythonpackages.com/buildout/plone/4.2.x ): [buildout] allow-hosts =
I have configured my application to use the Service configuration Local in the development
I have configured in following way that spring MVC app using Spring 3.1.1.RELEASE web.xml
I have configured the Azure AppFabric Cache as session provider in my ASP.NET MVC
I have configured Reporting Services to allow users to use Report Builder application. Users
I have configured Appstats on my Java Appengine application and noticed that a single
I have configured spring security with a ldap server (but continue reading, it's not
I have configured a site to use SSL, thus I added following section in
I have configured my Business Application to use Windows Authentication. From everything that I
I have configured smtp gmail for mail sending. It sends mail well, but when

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.