php - Call to system's arp command fails with shell_exec -
i has been searching long time in google not looking for. have local web application business in different building of office. staff use application in local network both wireless devices , desktop computer. want give them access through limited devices , machines.
i can mac address of connected devices passing ip addresses arp
, instance:
arp -n 192.168.10.12
in terminal.
but can't output when run same command in php script
$output = shell_exec('arp -n 192.168.10.12'); echo "<pre>$output</pre>";
i tried commands such ls -l /var/www
in shell_exec
function, these commands display same in command line. question why can't run arp -n ipaddress
command , how run it.
i can't check mac address via router because business clients use network when come office.
thanks in advance.
i followed this link.
i'm pretty sure www-user
not allowed use arp
command or reference full path.
use full path /usr/sbin/arp
.
it either works or sais no permission then. if no permission, search sudo
, let www-user
access arp
.
dan@big:/root$ /usr/sbin/arp address hwtype hwaddress flags mask iface xxxx.xx.xx.xxxx ether 00:00:xx:00:01:xx c eth0 dan@big:/root$ arp bash: arp: command not found
Comments
Post a Comment