deeem Posted February 18, 2009 Share Posted February 18, 2009 Recently upgraded our PHP install from 5.2.0 to 5.2.8. Everything continued working without a hitch, except one script... The Wake-On-LAN one. This script was written by someone else (I have a feeling I originally got it off this forum) and barely changed for my use: function WakeOnLan($mac) { // Create Magic Packet for($i=0;$i<6;$i++) $packet .= chr(255); $mac_byte = explode(':', $mac); for($i=0;$i<6;$i++) $mac_addr .= chr(hexdec($mac_byte[$i])); for($i=0;$i<16;$i++) $packet .= $mac_addr; // Set to UDP broadcast $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); socket_set_option($sock, SOL_SOCKET, SO_BROADCAST, TRUE); socket_sendto($sock, $packet, strlen($packet), 0, '255.255.255.255', 9); socket_close($sock); return; } $mac = $_GET['pcid']; WakeOnLan($mac); It exits on the socket_create without generating an error, even with error_reporting set to E_ALL. Have checked the usage of socket_create on the PHP site, but all seems in order. This is PHP running under IIS6 on Win2003 as an ISAPI module. Can anyone offer any help? Link to comment https://forums.phpfreaks.com/topic/145736-wake-on-lansockets-script-stopped-working-after-528-upgrade/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.