The Capifony site makes mention of how to set which PHP binary is run.
All symfony tasks (both symfony 1.x and Symfony2) run using the
default php binary on the production server. You can change this via:
set :php_bin, "/path/to/php"
Try setting the string to "/usr/bin/env php -d memory_limit=-1"
. The /usr/bin/env part is a Linux tool that will search the PATH for the given program, to avoid having to 'hard-code' the full path of the program into place.