I am getting a memory error in a php cron job:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /opt/matrix/core/lib/DAL/DAL.inc on line 830
The applicable parts of the crontab are:
$ sudo crontab -u www-data -l
MAILTO=root
# m h dom mon dow command
*/15 * * * * php /opt/matrix/core/cron/run.php /opt/matrix
I am running on Debian Squeeze, fully updated.
The obvious solution would be that the cli has a low memory limit (of 64MB). However, /etc/php5/cli/php.ini says it's unlimited.
$ cat /etc/php5/cli/php.ini | grep memory_limit
memory_limit = -1
I read somewhere that it could be different for different users, and since the process is running as www-data, i ran:
$ sudo -u www-data -s
$ php -i | grep memory_limit
memory_limit => -1 => -1
suhosin.memory_limit => 0 => 0
Even the apache/php.ini has a higher limit than the error is claiming:
$ sudo cat /etc/php5/apache2/php.ini | grep memory_limit
memory_limit = 128M
What am I missing? Where is this memory limit?