Ask your Symfony questions! Pay money and get answers fast! (more info)

Fatal error when trying to run 'propel:build-model' Symfony

  • SOLVED

Frustrating. We just moved to a new server. I try to run "symfony propel:build-model" and I get an out of memory error:

./symfony propel:build-model

[propel-om] Could not perform XLST transformation. Make sure PHP has been compiled/configured to support XSLT.
[propel-om] Could not perform XLST transformation. Make sure PHP has been compiled/configured to support XSLT.
[propel-om] Could not perform XLST transformation. Make sure PHP has been compiled/configured to support XSLT.
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /usr/share/php/symfony/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5ObjectBuilder.php on line 1839

>> schema converting "/home/tma/core/config/schema.yml" to XML
>> schema putting /home/tma/core/config/generated-schema.xml
>> schema converting "/home/tma/core/plug...lugin/config/schema.yml" to XML
>> schema putting /home/tma/core/plugins/...ggableBehaviorPlugin-schema.xml
>> schema converting "/home/tma/core/plug...lugin/config/schema.yml" to XML
>> schema putting /home/tma/core/plugins/...erated-sfGuardPlugin-schema.xml
>> file+ config/generated-sfPropelActAsTaggableBehaviorPlugin-schema.xml
>> file- /home/tma/core/plugins/sfPropel...ggableBehaviorPlugin-schema.xml
>> file+ config/generated-sfGuardPlugin-schema.xml
>> file- /home/tma/core/plugins/sfGuardP...erated-sfGuardPlugin-schema.xml
>> propel Running "om" phing task
Buildfile: /usr/share/php/symfony/plugins/sfPropelPlugin/lib/vendor/propel-generator/build.xml
[resolvepath] Resolved /home/tma/core/config to /home/tma/core/config

propel-project-builder > check-project-or-dir-set:


propel-project-builder > check-project-set:


propel-project-builder > set-project-dir:


propel-project-builder > check-buildprops-exists:


propel-project-builder > check-buildprops-for-propel-gen:


propel-project-builder > check-buildprops:


propel-project-builder > configure:

[echo] Loading project-specific props from /home/tma/core/config/propel.ini
[property] Loading /home/tma/core/config/propel.ini

propel-project-builder > om:

[phing] Calling Buildfile '/usr/share/php/symfony/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml' with target 'om'
[property] Loading /usr/share/php/symfony/plugins/sfPropelPlugin/lib/vendor/propel-generator/./default.properties

propel > check-run-only-on-schema-change:


propel > om-check:


propel > mysqli-check:


propel > om:

[echo] +------------------------------------------+
[echo] | |
[echo] | Generating Peer-based Object Model for |
[echo] | YOUR Propel project! |
[echo] | |
[echo] +------------------------------------------+
[phingcall] Calling Buildfile '/usr/share/php/symfony/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml' with target 'om-template'
[property] Loading /usr/share/php/symfony/plugins/sfPropelPlugin/lib/vendor/propel-generator/./default.properties

propel > om-template:

[propel-om] Processing: generated-sfGuardPlugin-schema.xml
[propel-om] Processing: generated-schema.xml
[propel-om] Processing: generated-sfPropelActAsTaggableBehaviorPlugin-schema.xml
[propel-om] Processing Datamodel : JoinedDataModel
[propel-om] - processing database : propel
[propel-om] + sf_guard_group
[propel-om] -> BasesfGuardGroupPeer [builder: SfPeerBuilder]



Any thoughts about how to work around this? And why would Symfony need more memory on the new server than the last server?

Answers (3)

2013-01-20

Milena Dimitrova answers:

You will have to increase the PHP memory limit in Command Line php.ini configuration file.

This file is typically located in: /etc/php5/cli/

Try for instance with the following setting:

memory_limit = 600M

In case you do not have access to this file you might have to simply build the model in your local environment and then just checkout/transfer the generated base classes to the new server.



Lawrence Krubner comments:

I have never seen this before. Do you know what it means?

php -i | grep memory
memory_limit => -1 => -1


Milena Dimitrova comments:

This command

php -i | grep memory_limit

checks the 'memory_limit' setting in php.ini.

However, PHP on the command line might use a different configuration file than the Apache version.

You can find the location of the currently loaded php.ini file with this command:

php -i | grep php.ini


Lawrence Krubner comments:

This:

php -i | grep php.ini
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini


If I open this:

/etc/php5/cli/php.ini

I see:

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = -1

See screenshot.

I am unclear what the -1 means, but in other programming languages it would suggest no limits.