Impossible to load fixtures in Symfony2 "Could not find any fixtures to load" Impossible to load fixtures in Symfony2 "Could not find any fixtures to load" symfony symfony

Impossible to load fixtures in Symfony2 "Could not find any fixtures to load"


I could not find a good example in the docs and finally found that this works. Just use the folder location and do not specify the fixture file.

doctrine:fixtures:load --fixtures=src/MyOrg/MyBundleBundle/DataFixtures/ORM --append


Take a look at the DoctrineFixturesBundle documentation.

Your data fixture classes need to implement OrderedFixtureInterface so they are loaded in a pre-set order.

You can then setup references with $this->addReference('ref-name', $variable) and refer to those references in another fixture with $this->getReference('ref-name').

My guess as to why it seemed to work on your linux box is because the fixures were loaded in a different order.


Just run into this aswell. My fixtures where working on my local windows environment, but failed in my linux production environment.

My problem was case sensitivity (as it is so often in windows-linux).

I named the data fixtures directory

Datafixtures

While the script looks for

DataFixtures

Spot the capital F in the second directory name, I didnt ;-)

I hope this saves someones time.