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?
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
You should try this set of permissions which are recommended by AWS:
First you need through a terminal go to your project directory and run the command:
ls -las
where you will see something like:
Note the columns where it says: webapp, that tells you which user/group have access to your project, so what you need to do now is go to your apache config file (normally you can find it in linux on: /etc/httpd/conf/httpd.conf) once you opened the file by using vi, vim or you favourite text editor you should look for User & Group and ensure that the user/group is the same one that the one from the image above and ensure that the user belongs to the group you have had configured or set on your httpd.conf then you should run the following command to apply the right set of permissions for users & groups by doing:
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} \;
find /var/www -type f -exec sudo chmod 0664 {} \;
and now it should work fine.
Note that /var/www is an example of where you could host your project but it depends on your configuration in the file httpd.conf
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With