Debian Squeeze: change the memory_limit parameter in / etc/php5/cli/php.ini
Nessun commento » Apache , Debian , PHP , Tips & Tricks No Comments »
On Debian Squeeze all there is to do a correction on the fly to php.ini dedicated to running server-side script (aka command line).
The correction is of vital importance, but only if you put in cron php script and do not want the server refuses to run because they require more memory than can be allocated.
The problem is due to the parameter:
memory_limit = -1
Since it would seem a flag disabled and then we would expect that there is no limit in the memory can be allocated, but the behavior is quite different:
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 64 bytes) in /var/www/clients/client21/web54/web/XXXXXX.php on line 212
As a workaround, you should specify which actually is the limit of memory that we intend to impose a php script run from command line. The parameter is in the file:
/etc/php5/cli/php.ini
And the change to be made is as follows:
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
;memory_limit = -1
memory_limit = 128M
Also sprach Uncle Vanya ![]()








