PHP Memory Limit - change without editing php.ini?

php, symfony

Solution

You can set it in PHP script with ini_set() function.

memory-limit directive is PHP_INI_ALL changeable, which means that it can be changed everywhere.

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

Problem

I'm using Symfony2 and on the server from the hosting I pay for I can see the error of exhausting memory. Is it possible to set new limit without editing php.ini (which is not accessible)?

Original source