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.
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.
i had the same problem, and also split up my fixtures files, but if you have access to the php ini file, you might just try increasing the php memory limit. that worked for me, but maybe you have a REALLY big fixtures file that would break even a max memory limit.
Post a Comment