shell_exec not returning output
Posted: Wed Sep 15, 2010 11:51 am
Hi all,
I'm running a script on an OpenBSD box we have set up as a gateway for 350 students in our residences. Every once in a while (generally about once every 2 or 3 days), we get errors that the ARP table is empty (we use that to get a user's MAC address).
Since this is a gateway for 350 students, it's highly unlikely that the ARP table is actually empty - which leads me to question why, when I call shell_exec("arp -a") that the returned string is empty.
Is there any chance shell_exec() is returning before arp returns, thereby not catching the output generated by the call? I call the command twice in rapid succession and when the error happens, both calls are affected by it. Failing that <not really a PHP question> do you know how/if it's possible the ARP table is empty?</not>
Thanks.
I'm running a script on an OpenBSD box we have set up as a gateway for 350 students in our residences. Every once in a while (generally about once every 2 or 3 days), we get errors that the ARP table is empty (we use that to get a user's MAC address).
Since this is a gateway for 350 students, it's highly unlikely that the ARP table is actually empty - which leads me to question why, when I call shell_exec("arp -a") that the returned string is empty.
Is there any chance shell_exec() is returning before arp returns, thereby not catching the output generated by the call? I call the command twice in rapid succession and when the error happens, both calls are affected by it. Failing that <not really a PHP question> do you know how/if it's possible the ARP table is empty?</not>
Thanks.