Fatal error: Call to a member function add() on a non-object
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Sat Sep 03, 2011 10:47 am
Fatal error: Call to a member function add() on a non-object
Hi all,
I have just deployed my website to a live host and I am getting the following issue:
- I go to Joomla 1.7 Back End
- I edit an Article in Article Manager
- I click on Save or Save As Button
- I get the following error:
Fatal error: Call to a member function add() on a non-object in /home/aleemee1/public_html/libraries/joomla/cache/storage/memcache.php on line 396
I tried to reupload my memcache.php page from local backup made from Akeeba Backup Engine but still getting the same issue.
I am using the CPanel to upload my files on the live host.
When i go to Line 396 in the memcache.php i get the following line of code (below in bold):
protected function lockindex()
{
$looptime = 300;
$data_lock = self::$_db->add($this->_hash.'-index_lock', 1, false, 30);
if ($data_lock === FALSE) {
$lock_counter = 0;
// Loop until you find that the lock has been released. that implies that data get from other thread has finished
while ( $data_lock === FALSE ) {
if ( $lock_counter > $looptime ) {
return false;
break;
}
usleep(100);
$data_lock = self::$_db->add($this->_hash.'-index_lock', 1, false, 30);
$lock_counter++;
}
}
return true;
}
Can anyone help me to resolve this issue?
Thanks in advance,
aleemeey
I have just deployed my website to a live host and I am getting the following issue:
- I go to Joomla 1.7 Back End
- I edit an Article in Article Manager
- I click on Save or Save As Button
- I get the following error:
Fatal error: Call to a member function add() on a non-object in /home/aleemee1/public_html/libraries/joomla/cache/storage/memcache.php on line 396
I tried to reupload my memcache.php page from local backup made from Akeeba Backup Engine but still getting the same issue.
I am using the CPanel to upload my files on the live host.
When i go to Line 396 in the memcache.php i get the following line of code (below in bold):
protected function lockindex()
{
$looptime = 300;
$data_lock = self::$_db->add($this->_hash.'-index_lock', 1, false, 30);
if ($data_lock === FALSE) {
$lock_counter = 0;
// Loop until you find that the lock has been released. that implies that data get from other thread has finished
while ( $data_lock === FALSE ) {
if ( $lock_counter > $looptime ) {
return false;
break;
}
usleep(100);
$data_lock = self::$_db->add($this->_hash.'-index_lock', 1, false, 30);
$lock_counter++;
}
}
return true;
}
Can anyone help me to resolve this issue?
Thanks in advance,
aleemeey
-
- Joomla! Fledgling
- Posts: 1
- Joined: Tue Sep 20, 2011 12:57 pm
Re: Fatal error: Call to a member function add() on a non-ob
Hi,
I had the same problem after restoring a site using Akeeba. I fixed it by going to the Global Configuration page, and on the System tab making sure all the Cache Settings were off. I found that although the main "Cache" setting was set to "OFF - Caching disabled", there was another cache setting that was still enabled. Unfortunately I can't remember what it was called and it seems to have disappeared now!
Also note that the global configuration page doesn't seem to work with IE9 (at least with Joomla 1.7), so I had to use Firefox to make this change.
Hope this helps,
Mark.
I had the same problem after restoring a site using Akeeba. I fixed it by going to the Global Configuration page, and on the System tab making sure all the Cache Settings were off. I found that although the main "Cache" setting was set to "OFF - Caching disabled", there was another cache setting that was still enabled. Unfortunately I can't remember what it was called and it seems to have disappeared now!
Also note that the global configuration page doesn't seem to work with IE9 (at least with Joomla 1.7), so I had to use Firefox to make this change.
Hope this helps,
Mark.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Sat Sep 03, 2011 10:47 am
Re: Fatal error: Call to a member function add() on a non-ob
Hi Mark,
i have disable all cache setting in the Global configuration page and it is working fine now. the other cache setting was memcache, when you disable it and save, it disappears.
Anyhow, i am no more getting the above error now.
Thanks for your help.
i have disable all cache setting in the Global configuration page and it is working fine now. the other cache setting was memcache, when you disable it and save, it disappears.
Anyhow, i am no more getting the above error now.
Thanks for your help.
-
- Joomla! Apprentice
- Posts: 39
- Joined: Wed Jun 04, 2008 5:24 pm
- Location: Ventura County
- Contact:
Re: Fatal error: Call to a member function add() on a non-ob
Sounds similar to my issue.
The site gives me an error when I search from the home page:
Fatal error: Call to a member function setState() on a non-object in /home/landcl24/public_html/NorCalDerm/modules/mod_cn_latestarticlesplus/helper.php on line 30
I turned on FireFox error console...this shows up:
Error: MightyMagoo FF:TypeError: Components.classes['textlinks@mmagoo.com'] is undefined
Source File: chrome://mmtextlinks/content/persistence.js
Line: 74
When I search from an inside page, no error and the search displays fine.
Any ideas?
Steve
The site gives me an error when I search from the home page:
Fatal error: Call to a member function setState() on a non-object in /home/landcl24/public_html/NorCalDerm/modules/mod_cn_latestarticlesplus/helper.php on line 30
I turned on FireFox error console...this shows up:
Error: MightyMagoo FF:TypeError: Components.classes['textlinks@mmagoo.com'] is undefined
Source File: chrome://mmtextlinks/content/persistence.js
Line: 74
When I search from an inside page, no error and the search displays fine.
Any ideas?
Steve
- lopezi
- Joomla! Apprentice
- Posts: 32
- Joined: Fri Aug 13, 2010 3:43 pm
Re: Fatal error: Call to a member function add() on a non-ob
cache OFF but error remains.
Cache Settings
Cache ...... OFF
Cache Time ......15
Persistent Memcache.......No
Memcache Compression.........No
any ideas?
Cache Settings
Cache ...... OFF
Cache Time ......15
Persistent Memcache.......No
Memcache Compression.........No
any ideas?
- lopezi
- Joomla! Apprentice
- Posts: 32
- Joined: Fri Aug 13, 2010 3:43 pm
Re: Fatal error: Call to a member function add() on a non-ob
Once in a while I stay tired of saving articles with that persistent error.
Fatal error: Call to a member function add() on a non-object in /home/lopezico/public_html/libraries/joomla/cache/storage/memcache.php on line 396
my cache is turned OFF, anyone knows how to fix this?
Fatal error: Call to a member function add() on a non-object in /home/lopezico/public_html/libraries/joomla/cache/storage/memcache.php on line 396
my cache is turned OFF, anyone knows how to fix this?
-
- Joomla! Fledgling
- Posts: 2
- Joined: Sat Jul 28, 2012 9:58 pm
Re: Fatal error: Call to a member function add() on a non-ob
Go to the configuration.php and change to this setting.
public $caching = '0';
public $cache_handler = 'file';
public $cachetime = '15';
instead of:-
public $caching = '0';
public $cache_handler = 'memcache';
public $cachetime = '30';
public $memcache_persist = '1';
public $memcache_compress = '0';
public $memcache_server_host = 'mem';
public $memcache_server_port = '11211';
This will manually change to 'file' from 'memcache' which will fix the problem. If you can't change in the settings.
public $caching = '0';
public $cache_handler = 'file';
public $cachetime = '15';
instead of:-
public $caching = '0';
public $cache_handler = 'memcache';
public $cachetime = '30';
public $memcache_persist = '1';
public $memcache_compress = '0';
public $memcache_server_host = 'mem';
public $memcache_server_port = '11211';
This will manually change to 'file' from 'memcache' which will fix the problem. If you can't change in the settings.
-
- Joomla! Apprentice
- Posts: 7
- Joined: Sat Aug 18, 2012 10:43 pm
Re: Fatal error: Call to a member function add() on a non-ob
Hi andytj,
I was experiencing this issue and manually changing $cache_handler='file' per you suggestion worked!! Thanks very much!
I was experiencing this issue and manually changing $cache_handler='file' per you suggestion worked!! Thanks very much!
-
- Joomla! Intern
- Posts: 70
- Joined: Thu Oct 04, 2012 1:10 pm
Re: Fatal error: Call to a member function add() on a non-ob
Its ok i've fig it! You just need to delete the cache folder: /cache/gantry