How to fix this symfony permission error?

Subhac05 picture Subhac05 · May 6, 2017 · Viewed 16.9k times · Source

On my live site I'm facing this problem when I load my browser:

ContextErrorException in FileProfilerStorage.php line 158: Warning: file_put_contents(/var/www/html/var/cache/dev/profiler/c9/73/fb73c9): failed to open stream: Permission denied

How can I fix this problem at the live site?

Answer

rafrsr picture rafrsr · May 7, 2017

Run

sudo chmod -R 777 var/cache

in your project directory, later clear the cache using

app/console cache:clear

An reset permissions again

sudo chmod -R 777 var/cache

Every time the cache is cleared reset permissions of folder cache to avoid this type of problems with created files during the clear process.

Note: app/console could be bin/console