system() question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
johncal
Forum Newbie
Posts: 2
Joined: Fri Mar 19, 2004 1:43 pm

system() question

Post by johncal »

Hello all,
Thanks in advance for reading.

I am working on a "network status" site
(sort of a graphical version of Big Brother)
and I am having trouble with the system() function.
An example would be

Code: Select all

system("uname -a")
So, the issue is I need this system() function to give me info
about another server, NOT the webserver that this php function
is physically on.

Using something like

Code: Select all

system("free -m")
correctly gives me the
memory info, however this info is for the webserver the code is on.
Again, I need to get info about
another webserver on the same network.

Also, all the boxes on the network are linux.
If I am still being vague, please let me know.

Thanks again for any input!

best regards,

John
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Post by mchaggis »

The following function should do you:

string exec ( string command [, array &output [, int &return_var]])
(http://uk.php.net/manual/en/function.exec.php)
Post Reply