Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 allowed memory exhausted when calling php app/console doctrine:schema:update

Tags:

symfony

I have a big problem...

I want to update the schema of my database and I have a problem.

When I a running this script:

php app/console doctrine:schema:update --dump-sql

I have this error:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in /Applications/MAMP/htdocs/myApp/vendor/doctrine/lib/Doctrine/ORM/Tools/SchemaTool.php on line 509

I have tried to increase memory_limit in php.ini but nothing works.

I have ran the php app/console cache:clear but it does nothing. Still the same problem...

Please help...

I can't do nothing...

like image 868
Sam Avatar asked Oct 25 '12 09:10

Sam


2 Answers

Do:

php -d memory_limit=200M app/console doctrine:schema:update --dump-sql

200M or higher

like image 141
webda2l Avatar answered Sep 21 '22 04:09

webda2l


First of all check php.ini location by creating php file that outputs php's configuration

<?php

    phpinfo();

Run this file in a browser and check "Loaded Configuration File" this is the location of php.ini.

Another method to solve the issue is to add the next line of code to app/console file:

ini_set('memory_limit', '64M');

64 MB should be enough

like image 23
Vadim Ashikhman Avatar answered Sep 18 '22 04:09

Vadim Ashikhman