i want to show my server status on my Web Page as the following:
Server Type Port Status
Web Server 80 On
Ftp Server 21 On
...
etc.
So what's the main function of PHP to do this?or how to do this?
thank you.
How to detect the port using PHP?
Moderator: General Moderators
Code: Select all
$tmp = exec("netstat -a", $results);
foreach ($results as $row)
{ echo $row . "<br>"; }
echo "done";-p TCP instead of -a ...
Also research [php_man]fsockopen[/php_man]()
And another for PEAR:
http://pear.php.net/manual/en/package.n ... ckport.php
And another for PEAR:
http://pear.php.net/manual/en/package.n ... ckport.php