PHP Classes
elePHPant
Icontem

PHP WOL Wake On LAN: Send Wake on LAN packet to wake up computer

Recommend this page to a friend!
  Info   View files Documentation   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2014-10-08 (4 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 295 All time: 7,272 This week: 462Up
Version License PHP version Categories
php-wol 1.1GNU General Publi...5.0Networking, PHP 5
Description Author

This class can send wake on LAN packet to wake up computer.

It takes IP the MAC address of the target machine and sends a wake on LAN magic packet as a UDP broadcast packet to port 9 by default.

If the host name of is given as parameter, the class can resolve it to use the IP address.

The target machine must have the wake on LAN featured enabled in the BIOS, which is usually disabled by default in most computers.

Innovation Award
PHP Programming Innovation award nominee
October 2014
Number 6
Wake on LAN is a protocol used to send a local network message to a computer that may have been put asleep for being inactive to save energy.

This class can send network packets to wake sleeping computers on the same network using the Wake on LAN protocol.

Manuel Lemos
  Performance   Level  
Name: Radovan Janjic is available for providing paid consulting. Contact Radovan Janjic .
Classes: 14 packages by
Country: Serbia Serbia
Age: 31
All time rank: 2652 in Serbia Serbia
Week rank: 54 Up1 in Serbia Serbia Up
Innovation award
Innovation award
Nominee: 3x

Details

PHP Wake-on-LAN

Wake-on-LAN (WoL) is an Ethernet computer networking standard that allows a computer to be turned on or awakened by a network message.

Usage

Example PHP usage:

/ Send WOL package
 * @param   string		$addr		- IP address
 * @param   string		$mac		- Media access control address (MAC)
 * @param   integer		$port		- Port number at which the data will be sent 
 * @return	boolean
 *
 * boolean send ( string $addr , string $mac [, integer $port = 9 ] )
 */
 
PHP_WOL::send('192.168.1.2', '01:23:45:67:89:ab', 9);

Configure BIOS

Wake On LAN is usually disabled by default in most PCs, enable it in your BIOS.

Configure router in order to work over internet

  • Setup port forwarding eg. 192.168.1.255 (usualy port 9 or 7), protocol UDP.

Linux

Install and configure earthquake package.

sudo aptitude install etherwake
  Files folder image Files  
File Role Description
Plain text file PHP_WOL.php Class Class source
Accessible without login Plain text file README.md Doc. Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:295
This week:0
All time:7,272
This week:462Up