Unable to set unlimited memory limit

I have a script that processes images that are uploaded by the user. However, I encountered this error

Fatal error: allowable memory size 134217728 Bytes exhausted

I read a lot of posts about this, but nobody is working. All of these messages are included using ini_set('Memory_limit', '-1');. I installed an unlimited amount, but nothing works. Even this failed and showed me the same error.

However, when I manually changed the memory limit from 128to 256in the file php.ini. It worked like a charm.

why did this happen and why doesn't it work init_set?

I did not even install suhosin

You can look at it. You can see my file phphere.

imagecreatetruecolor php uses too much memory

+4
source share
3 answers

If you check your file php.ini, you will get it memory_limitnot memory_limit.

See here: - http://prntscr.com/agxrtt

So change ini_set('Memory_limit','-1')to ini_set('memory_limit',256)orini_set('Memory_limit','-1')

+8
source

case sensitivity maybe?

lowercase M in memory_limit.

Could you try and let us know?

+7
source

You use capital M on memory_limit, do:

ini_set('memory_limit', '-1')
+6
source

All Articles