cannot use Net_Ping 2.4

From: Date: Mon, 08 Mar 2004 19:34:47 +0000
Subject: cannot use Net_Ping 2.4
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11155@lists.php.net to get a copy of this message
Hi there, I am trying to use Net_Ping, but I am running into some problems. I am not sure I am calling it in the right way. Thank you for your attention, Felipe Ceglia I have the function: function pinga_endp($ip) { require_once "Net/Ping.php"; $ping = new Net_Ping; $ping->setArgs(array( "timeout" => 10,"count" => 5,"size" => 32,"ttl" => 128 )); $pingTest = $ping->ping("127.0.0.1"); print "<hr>"; print_r($pingTest); print "<hr>"; } ---------------------------------------------------------------------------------------------------------------- it returns me: arning: Missing argument 1 for net_ping() in /usr/local/lib/php/Net/Ping.php on line 135 Warning: Missing argument 2 for net_ping() in /usr/local/lib/php/Net/Ping.php on line 135 object(pear_error)(8) { ["error_message_prefix"]=> string(0) "" ["mode"]=> int(1) ["level"]=> int(1024) ["code"]=> int(1) ["message"]=> string(12) "unknown host" ["userinfo"]=> NULL ["backtrace"]=> array(7) {
    [0]=>
    array(6) {
      ["file"]=>
      string(27) "/usr/local/lib/php/PEAR.php"
      ["line"]=>
      int(534)
      ["function"]=>
      string(10) "pear_error"
      ["class"]=>
      string(10) "pear_error"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(5) {
        [0]=>
        string(12) "unknown host"
        [1]=>
        int(1)
        [2]=>
        int(1)
        [3]=>
        int(1024)
        [4]=>
        NULL
      }
    }
    [1]=>
    array(6) {
      ["file"]=>
      string(27) "/usr/local/lib/php/PEAR.php"
      ["line"]=>
      int(555)
      ["function"]=>
      string(10) "raiseerror"
      ["class"]=>
      string(4) "pear"
      ["type"]=>
      string(2) "::"
      ["args"]=>
      array(5) {
        [0]=>
        string(12) "unknown host"
        [1]=>
        int(1)
        [2]=>
        NULL
        [3]=>
        NULL
        [4]=>
        NULL
      }
    }
    [2]=>
    array(6) {
      ["file"]=>
      string(31) "/usr/local/lib/php/Net/Ping.php"
      ["line"]=>
      int(312)
      ["function"]=>
      string(10) "throwerror"
      ["class"]=>
      string(4) "pear"
      ["type"]=>
      string(2) "::"
      ["args"]=>
      array(2) {
        [0]=>
        string(12) "unknown host"
        [1]=>
        int(1)
      }
    }
    [3]=>
    array(6) {
      ["file"]=>
      string(40) "/home/httpd/admin/callcenter/funcoes.php"
      ["line"]=>
      int(13)
      ["function"]=>
      string(4) "ping"
      ["class"]=>
      string(8) "net_ping"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(1) {
        [0]=>
        string(9) "127.0.0.1"
      }
    }
    [4]=>
    array(4) {
      ["file"]=>
      string(40) "/home/httpd/admin/callcenter/funcoes.php"
      ["line"]=>
      int(35)
      ["function"]=>
      string(10) "pinga_endp"
      ["args"]=>
      array(1) {
        [0]=>
        &string(10) "10.255.2.6"
      }
    }
    [5]=>
    array(4) {
      ["file"]=>
      string(40) "/home/httpd/admin/callcenter/funcoes.php"
      ["line"]=>
      int(94)
      ["function"]=>
      string(6) "status"
      ["args"]=>
      array(1) {
        [0]=>
        &array(6) {
          ["endpoint"]=>
          string(8) "22226666"
          ["ip"]=>
          string(10) "10.255.2.6"
          ["local"]=>
          string(19) "SAO PAULO - SP - BR"
          ["obs"]=>
          string(0) ""
          ["credito"]=>
          string(6) "0.0005"
          ["autorizado"]=>
          string(1) "t"
        }
      }
    }
    [6]=>
    array(4) {
      ["file"]=>
      string(38) "/home/httpd/admin/callcenter/index.php"
      ["line"]=>
      int(15)
      ["function"]=>
      string(9) "pesquisar"
      ["args"]=>
      array(2) {
        [0]=>
        &string(8) "endpoint"
        [1]=>
        &string(8) "22226666"
      }
    }
} ["callback"]=> NULL } -------------------------------------------------------------------------------------------------------------------- I do have on my pear: INSTALLED PACKAGES: ===================
PACKAGE        VERSION STATE
Archive_Tar    1.1     stable
Console_Getopt 1.2     stable
DB             1.6.0   stable
DB_Pager       0.7     stable
HTML_Common    1.2.1   stable
HTML_Table     1.5     stable
HTTP           1.2.3   stable
Mail           1.1.2   stable
Net_Ping       2.4     stable
Net_SMTP       1.2.3   stable
Net_Socket     1.0.1   stable
PEAR           1.3     stable
XML_Parser     1.0.1   stable
XML_RPC        1.0.4   stable 


« previous php.pear.general (#11155) next »