Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony : PHP Fatal error: Allowed memory size

I try to run this command to build model in my symfony project(1.4) :

php symfony propel:build-model( or all ) 

I have this error :

PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 20 bytes) in /home/sfprojects/jobeet/lib/vendor/symfony/lib/util/sfClassManipulator.class.php on line 176

I searched before asking people here so I changed memory_limit = 64M in my php.ini to 128M , 510M , 1024M ... but I have the same error that really get me crazy!

I'm using Ubuntu with apache2,php5...

like image 307
Nll Avatar asked Oct 12 '25 08:10

Nll


2 Answers

Make sure you edited your php.ini file for php-cli and not for Apache. In /etc/php5/cli/php.ini for your Ubuntu.

like image 52
sinhix Avatar answered Oct 15 '25 05:10

sinhix


Edit: Sorry, this was meant as a response to How can I increase the allowed memory size in Symfony? (I had both open at the same time.)

You probably have something like this in your composer.json:

"scripts": {
    "auto-scripts": {
        "cache:clear": "symfony-cmd",

Replace it by

"scripts": {
    "auto-scripts": {
        "php -dmemory_limit=512M bin/console cache:clear": "script",
like image 45
Christian Avatar answered Oct 15 '25 06:10

Christian