PHP Wake On Lan

From ip tuning
Jump to: navigation, search


PHO Wake On Lan - Wake devices using Magic Packets

   Copyright (c) 2014 by Barry Schiffer www.barryschiffer.com

   Original code: http://www.barryschiffer.com/using-synology-disk-station-wake-lan/

   Additional changes Copyright (c) 2014 by Manuel Azevedo <azevedo.manuel[at]gmail[dot]com>


Version 1.0 - 5th November 2014

Description

This tool allows you to wake network devices using a WOL Magic Packet.

Requirements

  • Web server with PHP installed
    • Tested with a Synology DSM 5.0

Limitations

  • There is no confirmation if the Magic Packet was received by the device. Pinging the device after sending the Magic Packet could be an option;
  • Apple MACs support WOL only in sleep mode - if the machine is shutdown, it will not start with a Magic Packet;

Configuration steps

Use config.php to change the application parameters;

The following options can be configured:

$sitename The site name
$port UDP port to send the Magic Packet
$networkbroadcast The broadcast address of the network[1]
$maclist An array with the MAC addresses. Format "hostname" => "XX:XX:XX:XX:XX:XX",[2]

Sample configuration parameters are on the file config.php.

Screenshots

PHPWOL on a web browser: host selection PHPWOL on a web browser: sent Magic Packet PHPWOL on an iPhone


Download

PHP, HTML, CSS and PNG files (zip)

File:Php-wake-on-lan-v1.0.zip

  1. Please note that Magic Packets are broadcasted in the network. WOL usually only works in the same network segment of the server. The broadcast address usually is the last address of the network.
  2. The application supports MAC addresses in any of the following formats: XX:XX:XX:XX:XX:XX, XX-XX-XX-XX-XX-XX, XXXX.XXXX.XXXX or XXXXXXXXXXXX.