|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-01-12 21:07 UTC] cataphract@php.net
-Status: Open
+Status: Bogus
[2012-01-12 21:07 UTC] cataphract@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 08:00:01 2025 UTC |
Description: ------------ Fatal error: Call to undefined function socket_create() in /home/faust/public_html/mysql/index.php on line 83 Test script: --------------- function ping($host, $timeout = 1) { /* ICMP ping packet with a pre-calculated checksum */ $package = "\x08\x00\x7d\x4b\x00\x00\x00\x00PingHost"; $socket = socket_create(AF_INET, SOCK_RAW, 1); socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => $timeout, 'usec' => 0)); socket_connect($socket, $host, null); $ts = microtime(true); socket_send($socket, $package, strLen($package), 0); if (socket_read($socket, 255)) $result = microtime(true) - $ts; else $result = false; socket_close($socket); return $result; } echo ping("google.de");