Jump to content

[resolved] Fatal error: Class 'Cache' not found


Recommended Posts

 I am install pretashop on localhost ,after this ,I add a module.

 

then i post the code to my server ,I modify the settings.inc.php about the database path; i update the domain path in server  database.

 

But I get an error :

 

Fatal error: Class 'Cache' not found in /home/ftp/g/geqixing2013/wwwroot/classes/ObjectModel.php on line 1513

 

the code blowe :

 

 

if (is_object($class))
$class = get_class($class);
 
if ($field === null)
$cache_id = 'objectmodel_def_'.$class;
if ($field !== null || !Cache::isStored($cache_id))             //P.s : line 1513
{
$reflection = new ReflectionClass($class);
$definition = $reflection->getStaticPropertyValue('definition');
 
$definition['classname'] = $class;
 
if (!empty($definition['multilang']))
$definition['associations'][Collection::LANG_ALIAS] = array(
'type' => self::HAS_MANY,
'field' => $definition['primary'],
'foreign_field' => $definition['primary'],
);
 
if ($field)
return isset($definition['fields'][$field]) ? $definition['fields'][$field] : null;
 
Cache::store($cache_id, $definition);
return $definition;
}
 
return Cache::retrieve($cache_id);

 

 

 

so  I alse view this pre topics fllower

 

http://www.prestashop.com/forums/topic/248711-fatal-error-class-cache-not-found/

 

http://www.prestashop.com/forums/topic/217916-solved-prestashop-1531-objectmodel-class-changes/

 

but util now,the problem is always exists. someone know how to solved it .

 

P.s. :  I am using the version of the last version:1.5.6

Edited by El Patron (see edit history)

Share this post


Link to post
Share on other sites

  • 1 month later...

this is not a good idea.  there are files and folders that need to exist under cache.

Hello,

 

It seems that I have the same problem. I delete the cache file in cache folder then I have reloaded it via ftp but my website is still not available. Message error :

 

Fatal error: Class 'Cache' not found in /var/www/prestashop/classes/ObjectModel.php on line 1537

 

Please there is someone who can help me ?

 

Thanks by advance.

Share this post


Link to post
Share on other sites

Hello,

 

It seems that I have the same problem. I delete the cache file in cache folder then I have reloaded it via ftp but my website is still not available. Message error :

 

Fatal error: Class 'Cache' not found in /var/www/prestashop/classes/ObjectModel.php on line 1537

 

Please there is someone who can help me ?

 

Thanks by advance.

 

try this,

 

delete "class_index.php" in cache folder.

  • Like 2

Share this post


Link to post
Share on other sites

  • 6 months later...
  • 1 year later...

Hi,

 

I have the same issue :

Fatal error : Class 'Cache' not found in /www/classes/ObjectModel.php on line 1552

 

 

 
But I checked my FTP, I don't have any Cache folder, so I cannot delete the class_index.php file...
 
What's wrong with it ?
 
Thanks,
 
Edit : I have Prestashop 1.6
Edited by deportelle (see edit history)

Share this post


Link to post
Share on other sites

 

Hi,

 

I have the same issue :

 
But I checked my FTP, I don't have any Cache folder, so I cannot delete the class_index.php file...
 
What's wrong with it ?
 
Thanks,
 
Edit : I have Prestashop 1.6

 

 

 

hi, all ps releases have folder in your shop root called 'cache'.  If you are missing this folder and still running, wow you lucky. :)

 

If you re-check and do not have this folder, then I would download the native PS that matches your version from here:

https://www.prestashop.com/en/developers-versions#previous-version

 

unpack/unzip the installation, then you can ftp the cache folder up, then delete the file.

 

good luck, el

Share this post


Link to post
Share on other sites

  • 1 year later...
  • 2 months later...
  • 2 weeks later...

Pls check the folder /classes/cache has following files:

  • Cache.php
  • CacheApc.php
  • CacheMemcache.php
  • CacheMemcached.php
  • CacheXcache.php
  • index.php

If not get it from the installation archive for your PS version.

Thanks a lot. 

i can't solve my problem only deleting "class_index.php" file. i solve my problem when put these file in recent folder and then delete "class_index.php" file.

Share this post


Link to post
Share on other sites

  • 4 months later...
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More