#1  
Old 22nd February 2009, 00: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
  #2  
Old 22nd February 2009, 19:13
homo homo is offline
Junior Member
 
Join Date: Jul 2008
Location: Greece
Posts: 21
Thanks: 2
Thanked 0 Times in 0 Posts
Default

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

Probably a permissions problem. I don't know if the webserver user is allowed to run cat /proc/meminfo.
__________________
Falko
--
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 13:18.
Reply With Quote
  #4  
Old 11th March 2009, 01:20
id10t id10t is offline
Senior Member
 
Join Date: Nov 2008
Posts: 240
Thanks: 2
Thanked 22 Times in 22 Posts
Default

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

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
Reply

Bookmarks

Tags
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 17:26
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 13:06
ispconfig php 5 errors itamarjp Installation/Configuration 8 25th April 2008 10:20
network issues now it says "401 The web site is blocked by administrator" Check General 3 26th February 2008 14:22
Apache2 Freezes celtic Server Operation 31 28th May 2007 17:18


All times are GMT +2. The time now is 01:15.


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