Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

memory limit in php

Tags:

php

curl

I'm making a curl request , witch was working perfectly for weeks, and now it's returning this error:

Allowed memory size of 262144 bytes exhausted (tried to allocate 76889 bytes)

The weird part is that i've checked php.ini and phpinfo and both tell me memory limit is

memory_limit 1028M

I've also tried

ini_set("memory_limit","400M"); 

In the top of the file to make sure, but still, getting this error.

This is happening in both development and production servers.

like image 862
monxas Avatar asked Nov 12 '22 15:11

monxas


1 Answers

DaveRandom nailed it. suhosin (I wasn't even aware we had that installed) was causing de issue by "overprotecting" the server.

[forums.cpanel.net/f5/php-memory-limit-problem-69715.html][1] - TL;DR it's being caused by suhosin. – DaveRandom

Thanks to all!

[1]: http://forums.cpanel.net/f5/php-memory-limit-problem-69715.html

UPS, that somehow fiexd the error in that part, but another part of the webapp is throwing same error.

I have no clue where to look at. it says memory limit is 1028M in php info, if i change it via ini_set, new value appears using ini_get, and now I have set suhosin to simulation. that somehow fixed the first problem, but now it reappeared.

like image 156
monxas Avatar answered Nov 15 '22 05:11

monxas