PHP Find out the RAM Baby

There is a web server with Linux. How to issue on the page how much free RAM has left. Moreover, the real RAM, not including any virtual.

Answer 1, Authority 100%

Maybe the function will help you

Answer 2

As it was previously -PHP

Code – Copy and Works

 $fh = fopen('/proc/meminfo','r');
  $mem = 0;
  while ($line = fgets($fh)) {
    $pieces = array();
    if (preg_match('/^MemFree:\s+(\d+)\skB$/', $line, $pieces)) {
      $mem = $pieces[1];
  echo "$mem kB RAM ";

So, in the link above – there are examples of other parsers!

Answer 3

Run / usr / bin / free and burst))