I am trying to write a php script that will display all active ethernet interfaces on my Linux server. I am using passthru() to pass shell commands to the system and then sed to trim the output. Now thee might be more than one active interace and the challenge is to have them displayed one at a time.
THis is what I have done so far:
Code: Select all
$int = 0;
while ($int <=3);
{
passthru("/sbin/ifconfig eth$int | sed -n '1,2p' ");
$int ++;
}Fatal error: Maximum execution time of 30 seconds exceeded in /srv/www/htdocs/admn/network.php on line 51
IS there an obvious flaw in my code or am I missing something else here?
Thanks