Old 22nd February 2009, 01:18
homo homo is offline
Junior Member
Join Date: Jul 2008
Location: Greece
Posts: 21
Thanks: 2
Thanked 0 Times in 0 Posts
Default Memory usage (PHP)

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%.
Reply With Quote
Sponsored Links
Old 22nd February 2009, 20:13
homo homo is offline
Junior Member
Join Date: Jul 2008
Location: Greece
Posts: 21
Thanks: 2
Thanked 0 Times in 0 Posts

I have made this scrip:

$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
Reply With Quote
Old 22nd February 2009, 21:30
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts

Probably a permissions problem. I don't know if the webserver user is allowed to run cat /proc/meminfo.
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:

Last edited by falko; 11th March 2009 at 14:18.
Reply With Quote
Old 11th March 2009, 02:20
id10t id10t is offline
Senior Member
Join Date: Nov 2008
Posts: 242
Thanks: 2
Thanked 22 Times in 22 Posts

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
Reply With Quote
Old 20th March 2009, 10:09
hardy123 hardy123 is offline
Junior Member
Join Date: May 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts

I havn't come across that type of problem so far.I think it will be great if i am able to solve it.
Mobile Ticketing
Reply With Quote


php memory usage script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 18:26
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 14:06
ispconfig php 5 errors itamarjp Installation/Configuration 8 25th April 2008 11:20
network issues now it says "401 The web site is blocked by administrator" Check General 3 26th February 2008 15:22
Apache2 Freezes celtic Server Operation 31 28th May 2007 18:18

All times are GMT +2. The time now is 00:09.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.