26/02/2015 - SYMFONY
We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.
This error occurs because the
framework: session: parameters in "app/config.yml" are not set properly so without the fix below, Symfony2 application will try to store the session data in non existing or unpermitted path.
Warning: SessionHandler::read(): open(/var/lib/php5/sessions/sess_tb9m9, O_RDWR) failed: Permission denied (13)
500 Internal Server Error - ContextErrorException
save_path parameters because Symfony2 uses session handler from "php.ini" by default and it will highly likely have no value assigned to it. Click here for more information.
You might need to define environment with
--env= tag if necessary. By default, command below would clear the cache of "dev" environment. Click here for more information.
php app/console cache:clear
Commands below apply to Ubuntu. Click here for more information.
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d -f1`
sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs