Skip to content
Server
2013.04.01 18:39

make ping with PHP(핑테스트)

조회 수 11144 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

make ping with PHP(핑테스트)

 

 

<?php
$ip = $_SERVER['127.0.0.1'];
exec("ping -n 4 $ip 2>&1", $output, $retval);
if ($retval != 0) { 
echo "no!"; 
} 
else 
{ 
echo "yes!"; }
?>

 

 

 

 

<?php
  function ping($host) {
    exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res, $rval);
    return $rval === 0;
  }

  $hosts_to_ping = array('10.140.206.123', '127.0.0.1');
?>

<ul>
<?php foreach ($hosts_to_ping as $host): ?>
  <li>
    <?php echo $host; ?>
    <?php $up = ping($host); ?>
    (<img src="<?php echo $up ? 'on' : 'off'; ?>"
          alt="<?php echo $up ? 'up' : 'down'; ?>">)
  </li>
<?php endforeach; ?>
</ul>

 

 

 

 

 

 

 

 

 

 

로그인 후 댓글쓰기가 가능합니다.

?

  1. 22
    Feb 2016
    09:47

    8기가 램에 맞는 Mysql config 셋팅 값

    CategoryServer Views3858
    Read More
  2. 13
    May 2013
    08:11

    Apache & Mysql 셋팅방법(httpd-mpm.conf / my.ini)

    CategoryServer Views13707
    Read More
  3. 23
    Mar 2016
    12:23

    APACHE PHP 에러 잡기

    CategoryServer Views9961
    Read More
  4. 06
    Sep 2016
    20:32

    Apache에 대한 mod_proxy 지원 구성

    CategoryServer Views1801
    Read More
  5. 02
    Jun 2015
    08:39

    APMSETUP7 PHP 업그레이드

    CategoryServer Views6373
    Read More
  6. 05
    Jan 2013
    08:23

    asp,jsp,php 아이피(ip) 가져오기/확인

    CategoryServer Views11867
    Read More
  7. 08
    Mar 2016
    19:40

    CSS, JS파일, gzip으로 한꺼번에 압축해서 전송하기

    CategoryServer Views1248
    Read More
  8. 12
    Apr 2016
    12:23

    ECS P43T-AD3, Asus C381GM, Driver(두번째 사용했던 서버 드라이버)

    CategoryServer Views2804
    Read More
  9. 22
    Dec 2016
    21:49

    FileZilla FTP SERVER 패시브모드 셋팅방법

    CategoryServer Views8780
    Read More
  10. 10
    Apr 2013
    08:11

    Google Chart API 이용하기

    CategoryServer Views20893
    Read More
  11. 06
    Nov 2016
    23:04

    HP XW6600 E5430 SPEC

    CategoryServer Views4732
    Read More
  12. 02
    Mar 2013
    08:03

    html) 프레임 나누기

    CategoryServer Views10198
    Read More
  13. 24
    Aug 2016
    13:32

    innodb_use_sys_malloc to FALSE

    CategoryServer Views2637
    Read More
  14. 23
    Aug 2016
    20:54

    innodb_use_sys_malloc에 따라 The InnoDB memory heap is disabled mysql error 메시지

    CategoryServer Views3794
    Read More
  15. 11
    Sep 2016
    22:19

    jQuery CDN

    CategoryServer Views4299
    Read More
  16. 01
    Apr 2013
    18:39

    make ping with PHP(핑테스트)

    CategoryServer Views11144
    Read More
  17. 27
    Nov 2016
    21:48

    Minify로 CSS, JS파일, gzip으로 한꺼번에 압축해서 전송하기

    CategoryServer Views4337
    Read More
  18. 03
    Mar 2016
    17:27

    MySQL - 속도저하에 따른 웹페이지 접속 지연

    CategoryServer Views1302
    Read More
  19. 26
    Jul 2016
    22:57

    mysql 16CPU / 16GB My.cnf

    CategoryServer Views2501
    Read More
  20. 24
    Mar 2016
    12:55

    MySQL 5.6 my.cnf 글로벌 변수인지 세션변수인지 확인

    CategoryServer Views1527
    Read More
Board Pagination Prev 1 2 3 4 5 Next
/ 5

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소