LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-03-2005, 09:12 AM   #1
mindfrost82
Member
 
Registered: Apr 2003
Distribution: Slackware
Posts: 60

Rep: Reputation: 15
Server load code Apache+PHP


I know this code is out there, but I'm having a hard time finding it.

On my website, I want it to display what the server load is...like:

0.02 0.05 0.01

I've seen it before on sites.

I have Slackware 10, Apache 1.3.33, PHP, MySQL.

Please let me know what the code is, if its PHP or something else.

Thanks
 
Old 01-03-2005, 10:43 AM   #2
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
PHP Code:
<?php
  $uptime 
exec('uptime');
  
$cpu_load substr($uptime, -16);
  echo 
$cpu_load;
?>
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in PHP 5.0.5 and Apache 1.3.34 - Cannot load libphp5.so jun_tuko Linux - Software 7 01-05-2008 11:12 PM
Test php code on Apache backpacker Linux - Newbie 3 12-17-2005 04:14 AM
configuring apache to load with php support jomy Linux - Networking 1 03-06-2005 08:38 AM
Set up Apache to read php IN html code? WorldBuilder Linux - Networking 10 01-27-2004 12:16 PM
Can't load php module in Apache pepino Linux - Newbie 2 10-21-2003 10:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration