2

I have no idea why or how this came to be, but for some odd reason PHP scripts on my server, once they utilize ini_set trying to influence the memory_limit setting, cause the script to completely crash. No error messages, no nothing. If i call the script through the browser, all i get is a blank page.

Any hints on this?

Update:

running 'free' returns

           total       used       free     shared    buffers     cached
Mem:       8190820    7922056     268764          0     565124    6598656
-/+ buffers/cache:     758276    7432544
Swap:      2102456          0    2102456

Is something hogging my memory?

running ps aux |grep apache gives me 'ERROR: Unsupported option (BSD syntax)'

Checking manually i found a whole bunch of lines refering to:

/usr/sbin/apache2 -k start

All at about 0.3% memory usage and owned by 'www-data'.

The scary part is that none of the processes listed by 'ps aux' uses more than 0.8% of the memory. And if i add up all the percentages listed, i never arrive at where i should according to what 'free' is telling me.

SquareCat
  • 5,699
  • 9
  • 41
  • 75

2 Answers2

0

try with this code:

ini_set('memory_limit', '-1');
PHP
  • 159
  • 3
  • 3
  • 12
0

I seem to remember there being a problem with requesting anything over 2GB. I think 2GB is the magic cut-off in at least some versions of PHP.

Andrew Kandels
  • 1,287
  • 1
  • 8
  • 10
  • I don't think is PHP related, more like a server has limited RAM resource allocated to user that executing the process (web or cli) – ajreal Mar 30 '12 at 20:32
  • I don't think this is the case because the error occurs regardless of the amount of memory being allocated. Another thing that i noticed is that on some requests i will get a "connection reset" error from the server. – SquareCat Mar 30 '12 at 20:46