is there a wake on lan script using a web language preferably php that works? Also one that has some documentation on how to get it to work like what needs to be enabled on your server etc
Enable Wake-on-LAN in WindowsRight-click on your Ethernet adapter—mine is called "Intel(R) l211 Gigabit Network Connection"—and select Properties. In the Advanced tab, scroll down to Wake On Magic Packet and ensure it is enabled using the drop-down box on the right.
Open the Command Prompt on the computer from which you will be sending the wake-on-LAN command. Type "ping" followed by the computer that you will be sending the wake-on-LAN command's IP address.
function wol($broadcast, $mac)
{
$hwaddr = pack('H*', preg_replace('/[^0-9a-fA-F]/', '', $mac));
// Create Magic Packet
$packet = sprintf(
'%s%s',
str_repeat(chr(255), 6),
str_repeat($hwaddr, 16)
);
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
if ($sock !== false) {
$options = socket_set_option($sock, SOL_SOCKET, SO_BROADCAST, true);
if ($options !== false) {
socket_sendto($sock, $packet, strlen($packet), 0, $broadcast, 7);
socket_close($sock);
}
}
}
Should work - call it with a broadcast IP address, and a MAC address
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With