Ok, I\'ve been at this for two hours now and I see some other people have had this error, but I can\'t seem to match their causes/resolutions with mine.
Fatal error:
Personally, I juste removed cache manually and it worked
rm -rf app/cache/*
Clearing cache was not fixing my problem.
In my case, it was a use
statement under the namespace which used the same classname (but another path).
namespace Bsz\RecordTab;
use \Bsz\Config\Libraries; // I used this in constructor
class Libraries
{
...
}
Without the use directive, it Worked
Sometimes, if you got seduced by copy/paste, check your classnames, namespaces and for other "typos" that could have happened. (copy/paste is the devil of programming :/)
So, turns out that was a clumpsy typo by moi there.
But for anyone else who runs into this error message in Symfony2:
Fatal error: require() [function.require]: Cannot redeclare class...
Here is a hint: check if you have accidentally deleted or typo:ed the namespace in the file that contains the definition of the class that php claims it is trying to re-define.
The php error message doesn't really give you a clue to look for that... =)
Similar to other answers, in my case I had renamed the class but not the containing file. Every class should be declared in a file with the same name. So check that, too.
redeclare class - Likely there is tow classes with the same name