RE: check socket status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Jim Moseby wrote:
> > Your server is *nix?  You could:
> >  
> > $netstat_info=`netstat -l`; // notice back-tics
> > 
> > ...then parse through the output.
> > 
> > JM
> 
> `netstat -l | grep 5514` gives me information about listening 
> service on 
> port 5514. That's all I needed but I only can get this from *nix 
> console. How could I test it on PHP server side ?
> 

Maybe I misunderstand what you are trying to do.  Run this on your server:

<?PHP
$netstat_info=`netstat -l`;
echo $netstat_info;
?>

Assuming it has permissions, and all the stars are aligned, you should get
the output of the 'netstat -l' command echoed to the screen.

Once you have that, you can parse through the text in $netstat_info for what
you want, or modify the command more to your liking (ie
$netstat_info=`netstat -l | grep 5514`;) or whatever.

JM

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux