PrestaShop 1.0删除缓存文件夹后出现Cache类未找到错误求助
解决PrestaShop 1.0删除缓存后出现Class 'Cache' not found的致命错误
我之前在处理PrestaShop 1.0的缓存问题时碰到过一模一样的情况,给你几个实测有效的解决步骤,应该能让你的站点恢复正常:
检查缓存文件夹权限
PrestaShop 1.0对缓存文件夹的读写权限要求很严格,哪怕你重新上传了缓存文件夹,权限不对也会导致系统无法生成关键的Cache类文件。请确保网站根目录下的cache/文件夹权限设置为755,文件夹内所有文件的权限设为644。如果不确定服务器的Web运行用户,可以联系主机服务商确认,确保该用户拥有对缓存文件夹的读写权限。强制重建缓存类文件
错误提示的Cache类是系统在缓存文件夹中自动生成的,重新上传旧的缓存文件根本解决不了问题,你得让系统重新生成:- 先清空
cache/文件夹内的所有文件(别删文件夹本身) - 打开
config/config.inc.php文件,确认_PS_CACHE_DIR_配置项指向的路径是正确的(应该是/customers/a/2/e/sekuurshop.be/httpd.www/cache/这类路径,确保没有拼写错误) - 直接访问你的网站首页,系统会自动触发缓存重建流程,这时
Cache类文件就会被重新生成
- 先清空
验证核心文件完整性
虽然你只是删除了缓存文件夹,但偶尔会出现误操作导致核心文件受损的情况。请检查classes/目录下是否存在Cache.php(PrestaShop 1.0的核心Cache类大概率存放在这里),如果缺失,得从PrestaShop 1.0的官方安装包中重新上传这个文件。刷新服务端与客户端缓存
- 清除浏览器的所有缓存和Cookie,避免旧的页面缓存干扰访问
- 联系主机服务商重启PHP服务,确保PHP的opcache或其他服务端缓存被完全清空
附上你遇到的错误信息以便参考:
Fatal error: Uncaught Error: Class 'Cache' not found in /customers/a/2/e/sekuurshop.be/httpd.www/classes/ObjectModel.php:1924 Stack trace: #0 /customers/a/2/e/sekuurshop.be/httpd.www/classes/ObjectModel.php(214): ObjectModelCore::getDefinition('Shop') #1 /customers/a/2/e/sekuurshop.be/httpd.www/classes/shop/Shop.php(130): ObjectModelCore->__construct('1', NULL, NULL) #2 /customers/a/2/e/sekuurshop.be/httpd.www/classes/shop/Shop.php(411): ShopCore->__construct('1') #3 /customers/a/2/e/sekuurshop.be/httpd.www/config/config.inc.php(117): ShopCore::initialize() #4 /customers/a/2/e/sekuurshop.be/httpd.www/index.php(27): require('/customers/a/2/...') #5 {main} thrown in /customers/a/2/e/sekuurshop.be/httpd.www/classes/ObjectModel.php on line 1924
内容的提问来源于stack exchange,提问作者Mohd Hasan
相关产品推荐
相关产品推荐

