简体   繁体   English

Symfony2缓存问题

[英]Symfony2 problems with cache

I have worked with one project on Symfony2. 我曾在Symfony2上进行过一个项目。 It works on my local server, but when I uploaded this project to the hosting, it has stopped working. 它可以在我的本地服务器上运行,但是当我将该项目上传到托管服务器时,它已经停止工作。 Over time I have found, that problem is with the cache directory. 随着时间的流逝,我发现问题出在缓存目录上。

So uploading the cache from the local server to the hosting has solved this problem. 因此,将缓存从本地服务器上传到托管已经解决了此问题。

What can the problem be? 可能是什么问题? What are the main problems with cache on Symfony2? Symfony2上的缓存的主要问题是什么?

You don't upload the cache folder. 您不上传缓存文件夹。 These are only temporary files. 这些只是临时文件。 Look at the docs about how to deploy . 查看有关如何部署文档

Most likely you have to run: 您最有可能必须运行:

php app/console cache:clear --env=prod --no-debug

Also check that the cache and log folder is writable as pointed out on the installation documentation : 还要检查缓存和日志文件夹是否可写,如安装文档中所述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM