PHP Classes

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
2024-01-09 (3 months ago) RSS 2.0 feedNot enough user ratingsTotal: 421 This week: 1All time: 6,384 This week: 104Up
Version License PHP version Categories
php-wol 1.10GNU 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
Picture of Radovan Janjic
  Performance   Level  
Name: Radovan Janjic is available for providing paid consulting. Contact Radovan Janjic .
Classes: 14 packages by
Country: Serbia Serbia
Age: 35
All time rank: 2382 in Serbia Serbia
Week rank: 25 Up1 in Serbia Serbia Up
Innovation award
Innovation award
Nominee: 3x

Documentation

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:421
This week:1
All time:6,384
This week:104Up