PHPã§ãµã¼ãã¼ã®æ»æ´»ç®¡ç ãµã¼ãã¼ãçãã¦ããæ»ãã§ããã確èªããã®ã«Pingã使ãæ¹ã¯ããã¨æãã¾ããã ä»åPHPããPingã使ãæ¹æ³ãç¥ã£ãã®ã§èªåç¨ã«ã¡ã¢ã execã使ç¨ããæ¹æ³ãfsocketopenã使ç¨ããæ¹æ³ã®ï¼ãã¿ã¼ã³ããã¾ããã fsockeopneã使ç¨ããã¨ãã¼ãã®æå®ãåºæ¥ãã®ã§ãMySQLãApacheã稼åãã¦ãããã®ãã§ãã¯ã«ã使ãã¾ãã ã½ã¼ã¹ã³ã¼ãã¯ä»¥ä¸ execã§ãµã¼ãã¼ã«pingãéä¿¡ããæ¹æ³ /* Pingéä¿¡ããã°ã©ã */ function ping($host) { $r = exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res, $rval); //pingã®çµæã表示 //print_r($r); return $rval === 0; } /* $hostã«æ»
{{#tags}}- {{label}}
{{/tags}}