I have been trying to load a large fixture file in Symfony but everytime I went to load the fixture using doctrine:load-data, Symfony would crash. I looked at the mySQL tables and found that Symfony had in fact finished loading the fixture, but for some reason had become non-responsive.
Solution:
To allow symfony to load the fixture (whether it crashes due to system resources like PHP memory or an issue with PHP itself), I found that I can control the loading of the fixture by following these simple steps.
- Split the fixture into several files (While keeping your table reference in each one)
- Load each fixture file 1 at a time (this can be accomplished using doctrine:data-load --append rel/path/to/fixture)
- check your tables to ensure data is still being loaded, if you find it has stalled more a good amount of time and nothing has been loaded, you will probably want to look into killing the PHP process (something I wont explain here) and doing some more fixture break downs.
1 comment