Iam searching for a script able to calculate the per sent (%) amount of ram used by the server, for example: used 512mb of 1024mb 50%.
I have made this scrip: <?php $mem = exec("cat /proc/meminfo"); $mem = split(" ",$mem); echo $mem[1]; ?> but the output is blank. I want to find the exact amount of the used memory, by making the string to integer
Probably a permissions problem. I don't know if the webserver user is allowed to run cat /proc/meminfo.
You could probably do something to work around the output of free (or maybe free -l ) and/or top, just call it from within php and then process its output