2
votes

I have a Symfony 1.4 project that I am unable to successsfuly run the task:

./symfony propel:build-model

This results in the following error:

PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /plugins/sfPropel15Plugin/lib/vendor/propel-generator/lib/builder/om/PHP5PeerBuilder.php on line 2033

Interestingly, I am able to run the build model class for this project on a machine with PHP 5.2 on it.

I am running this on a VMware Player virtual machine build with PHP 5.3.3 installed. I've tried increasing the memory_limit in the php.ini file to rediculously high amounts but it still bombs.

2
are you sure you upped the limit in the CLI ini?prodigitalson
you can try manually upping the memory limit from the symfony file that you call for any script i.e.- ini_set('memory_limit', '128M'); right at the beginning of the symfony file in your symfony rootPatrick
Agreed on upping the limit. As suggested there may be 2 places you need to increase it. It often that website php runs through apache whereas cli php does not. Make sure that "Allowed memory size" changes when you up the limit.Jestep

2 Answers

3
votes

Solution: set memory_limit in the php.ini used by CLI to a value other than -1.

In the configuration you mentioned (at least PHP 5.3, Symfony 1.3), there appears to be a bug in Symfony that faults when the value of memory_limit is -1.

0
votes

Ok, yes...I am an idiot.

I was unaware of the CLI specific .ini file.

I upped the memory_limit in the /etc/php5/cli/php.ini file and things worked fine.

Thanks everyone.