views:

293

answers:

3
ini_set('max_execution_time',0);
ini_set('memory_limit','1000M');

These are the first two lines at the very top of my script.

I was under the impression if I ran something via cron memory limits didn't apply, but I was wrong. Safe mode is off and when I test to see if these values are being set they are but I keep getting the good ol' "PHP Fatal: Memory exhausted" error.

Any ideas what I may be doing wrong? And whats the "more elegant way" of writing "infinite" for the "memory limit" value is it -1 or something?

A: 

Hi,

possible that suhosin is running on your Server? If yes, you have to set the "suhosin.memory_limit" inside your php.ini.

Suhosin does now allow to allocate more memory, even if safemode is off.

ArneRie
if it didn't come with the php installation, it's not on the server.
John
A: 

Changed memory limit to -1 instead of '1000M' now everything works perfectly.

John
A: 

You can't use non-numeric values ("M", "K") outside php.ini proper. Setting 10000000 would probably work.

Pekka