Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symfony2 all of a sudden broken?

Tags:

php

symfony

As much as I love Symfony2, this ain't the first time I come back after not developing for a week, and there is a weird error message...

Warning: Class __PHP_Incomplete_Class has no unserializer in /var/www/my_app/vendor/symfony/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php line 153

I certainly didn't touch that file... Tried googling it but only found some answers where people had used cache:clear command, or installed vendors, or moved entities. As I said, I haven't done anything... I changed the directory name where symfony2 is located, but that shouldn't affect it... Anyways I changed it back later and still same issue. Cache cleared (manually, deleted folders cache and logs) and apache2 restarted...

Anyone run into the same problem before?

like image 771
Matt Welander Avatar asked Sep 05 '12 08:09

Matt Welander


2 Answers

Solution is to run the cache:clear command

cd symfony/app
php console cache:clear

and not just manually delete the folders app/cache and app/logs

like image 121
Matt Welander Avatar answered Oct 19 '22 12:10

Matt Welander


I had this same problem, and clearing the cache was only a temporary fix. The problem was that there were two instance of Symfony that had conflicting sessions. The way I fixed it was to give each instance of Symfony their own session name in the config.yml

framework:
    session:
        name: "NewSessionName"
like image 36
Chris Butcher Avatar answered Oct 19 '22 12:10

Chris Butcher