After reinstalling my wamp environment this error message is showing on screen after I open app_dev.php:
Fatal error: Cannot redeclare class SessionHa
I was having caching issues even when using app_dev.php. I would change a route but it wouldn't update when I tried accessing it via a browser.
I tried commenting out the anything that had cache in it (as stated above). None of that worked.
If I ran the console cache:clear it would fix it, but the next routing change would break again. I had to run cache:clear with every save, which was ridiculous.
My issue turned out that because I was working remotely over SFTP, PHP Storm (my editor) was "preserving timestamp" in its deployment configuration. Once I changed that configuration the issues went away. Apparently there is some caching going on that is looking at the file timestamps, even in the dev environment.
I solved it clearing the cache:
app/console cache:clear
PHP version 5.4 introduced a new session management system based on an interface called SessionHandlerInterface and it would seem that your Symfony2 code declares a class with the very same name in the global namespace, so there is a name clash.
Here are the docs: http://www.php.net/manual/en/class.sessionhandlerinterface.php
SessionHandlerInterface is an interface which defines a prototype for creating a custom session handler. In order to pass a custom session handler to session_set_save_handler() using its OOP invocation, the class must implement this interface.
Make sure you have defined namespace in your interface SessionHandlerInterface
EX:
namespace app\cache\dev;
Only this worked for me rm -rf app/cache/*
Just try to clear the Symfony2 cache with the one (or all) the commands below :
php app/console cache:clear --env=prod --no-debug (on production mode)
or / and
php app/console cache:clear --env=dev --no-debug (on development mode)