HELP! I can’t clear my Symfony cache on my production server! Have no fear…

On occasion, if you’re lucky enough to have a busy site, you may not have enough file descriptors to access the command line. This happens during peak hours on many sites, especially on shared hosting, but I’ve also seen it on VPS as well.

For all you Sensio Labs Symfony people out there, you know if you make a change to the code chances are you need to clear the server cache, so what do you do if you can’t get on the server’s command line because of some crazy activity quota? You’ll have to do it manually:

Here’s what you need to usually do to clear the cache if you have access to the command line but perhaps app/console isn’t accessible, go to your Symfony root and type:

 rm -Rf app/cache/*. 

After that you should warm up cache by typing in:

 app/console cache:warmup --env=prod

So, if you can’t get in the command line, you need to use your file manager and go the the app/cache folder and delete everything in the folder. This may take a couple of minutes. Please note that users will lose their current session data if you did not configure “session: save_path” in your config.yml.

About Author:

Senior Cloud Software Engineer and 25+ years experienced video production, video editing and 3D animation services for a variety of global clients including local video production here in Jacksonville, Florida.

Leave a Comment

Your email address will not be published. Required fields are marked *