skip to Main Content

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?



  1. Chosen as BEST ANSWER

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

  2. 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.

    Login or Signup to reply.
  3. You can’t use non-numeric values (“M”, “K”) outside php.ini proper. Setting 10000000 would probably work.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top