0

Is there any option to get all domain related HTTP connections that are made without exec?

I am using netstat | grep http | wc -l in terminal, and in php I am using exec.

The question is if there is any option to get this without the "exec" function.

MM PP
  • 4,050
  • 9
  • 35
  • 61

1 Answers1

0

I don't think you can find any native PHP functions for replacing 'netstat'. 'netstat' is one of the tools provided by 'net-tools' package (http://sourceforge.net/projects/net-tools/). You have to use 'exec' or 'system', no other go. (PHP - exec() vs system() vs passthru())

THere seems to be some netstat php scripts, which i didn't checked out fully, you can try them out if you like. However i don't think they can provide you with 'all domain' information.

https://github.com/netstat-php/netstat_php/blob/master/netstat.php

http://www.fam.tuwien.ac.at/~schamane/_/netstat_php

Community
  • 1
  • 1
Manikandaraj Srinivasan
  • 3,557
  • 5
  • 35
  • 62