Package: php-net-ping
Version: 2.4.5-1
Severity: important
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi, testing new version I've found it cannot ping IP addresses but no is not
failing if you ping hostnames.
Here is a quick+dirty test code:
<?php
function exec_ping($target)
{
require_once "/usr/share/php/Net/Ping.php";
$ping = Net_Ping::factory();
if(PEAR::isError($ping)) {
echo $ping->getMessage();
} else {
$ping->setArgs(array('count' => 3));
print "<pre>\n";
print "<h1>Target: $target</h1>\n";
var_dump($ping->ping($target));
print "</pre>\n";
print "<hr>\n";
}
}
exec_ping("example.com");
exec_ping("192.0.32.10");
?>
- --- [ OUTPUT ] ---
Target: example.com
object(Net_Ping_Result)#2 (11) {
["_icmp_sequence"]=>
array(3) {
[1]=>
float(227)
[2]=>
float(220)
[3]=>
float(239)
}
["_target_ip"]=>
string(11) "192.0.32.10"
["_bytes_per_request"]=>
int(64)
["_bytes_total"]=>
int(192)
["_ttl"]=>
int(240)
["_raw_data"]=>
array(8) {
[0]=>
string(52) "PING example.com (192.0.32.10) 56(84) bytes of data."
[1]=>
string(75) "64 bytes from www.example.com (192.0.32.10): icmp_seq=1 ttl=240
time=227 ms"
[2]=>
string(75) "64 bytes from www.example.com (192.0.32.10): icmp_seq=2 ttl=240
time=220 ms"
[3]=>
string(75) "64 bytes from www.example.com (192.0.32.10): icmp_seq=3 ttl=236
time=239 ms"
[4]=>
string(0) ""
[5]=>
string(35) "--- example.com ping statistics ---"
[6]=>
string(62) "3 packets transmitted, 3 received, 0% packet loss, time 2000ms"
[7]=>
string(55) "rtt min/avg/max/mdev = 220.130/229.057/239.701/8.081 ms"
}
["_sysname"]=>
string(5) "linux"
["_round_trip"]=>
array(4) {
["min"]=>
float(220.13)
["avg"]=>
float(229.057)
["max"]=>
float(239.701)
["stddev"]=>
float(8.081)
}
["_transmitted"]=>
int(3)
["_received"]=>
int(3)
["_loss"]=>
int(0)
}
Target: 192.0.32.10
object(PEAR_Error)#2 (8) {
["error_message_prefix"]=>
string(0) ""
["mode"]=>
int(1)
["level"]=>
int(1024)
["code"]=>
int(0)
["message"]=>
string(24) "execution of ping failed"
["userinfo"]=>
NULL
["backtrace"]=>
array(4) {
[0]=>
array(6) {
["file"]=>
string(23) "/usr/share/php/PEAR.php"
["line"]=>
int(566)
["function"]=>
string(10) "PEAR_Error"
["class"]=>
string(10) "PEAR_Error"
["type"]=>
string(2) "->"
["args"]=>
array(5) {
[0]=>
string(24) "execution of ping failed"
[1]=>
int(0)
[2]=>
int(1)
[3]=>
int(1024)
[4]=>
NULL
}
}
[1]=>
array(7) {
["file"]=>
string(27) "/usr/share/php/Net/Ping.php"
["line"]=>
int(383)
["function"]=>
string(10) "raiseError"
["class"]=>
string(4) "PEAR"
["object"]=>
object(Net_Ping)#1 (7) {
["_ping_path"]=>
string(9) "/bin/ping"
["_result"]=>
array(0) {
}
["_OS_Guess"]=>
string(0) ""
["_sysname"]=>
string(11) "linuxdebian"
["_args"]=>
array(1) {
["count"]=>
int(3)
}
["_noArgs"]=>
bool(false)
["_argRelation"]=>
array(12) {
["sunos"]=>
array(6) {
["timeout"]=>
NULL
["ttl"]=>
string(2) "-t"
["count"]=>
string(1) " "
["quiet"]=>
string(2) "-q"
["size"]=>
string(1) " "
["iface"]=>
string(2) "-i"
}
["freebsd"]=>
array(6) {
["timeout"]=>
string(2) "-t"
["ttl"]=>
string(2) "-m"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
NULL
["iface"]=>
NULL
}
["netbsd"]=>
array(6) {
["timeout"]=>
string(2) "-w"
["iface"]=>
string(2) "-I"
["ttl"]=>
string(2) "-T"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
}
["openbsd"]=>
array(6) {
["timeout"]=>
string(2) "-w"
["iface"]=>
string(2) "-I"
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
}
["darwin"]=>
array(6) {
["timeout"]=>
string(2) "-t"
["iface"]=>
NULL
["ttl"]=>
NULL
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
NULL
}
["linux"]=>
array(7) {
["timeout"]=>
string(2) "-W"
["iface"]=>
NULL
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
["deadline"]=>
string(2) "-w"
}
["linuxdebian"]=>
array(7) {
["timeout"]=>
string(2) "-W"
["iface"]=>
NULL
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
["deadline"]=>
string(2) "-w"
}
["linuxredhat8"]=>
array(7) {
["timeout"]=>
NULL
["iface"]=>
string(2) "-I"
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
["deadline"]=>
string(2) "-w"
}
["linuxredhat9"]=>
array(7) {
["timeout"]=>
string(2) "-W"
["iface"]=>
string(2) "-I"
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
["deadline"]=>
string(2) "-w"
}
["windows"]=>
array(6) {
["timeout"]=>
string(2) "-w"
["iface"]=>
NULL
["ttl"]=>
string(2) "-i"
["count"]=>
string(2) "-n"
["quiet"]=>
NULL
["size"]=>
string(2) "-l"
}
["hpux"]=>
array(6) {
["timeout"]=>
NULL
["iface"]=>
NULL
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-n"
["quiet"]=>
NULL
["size"]=>
string(1) " "
}
["aix"]=>
array(6) {
["timeout"]=>
string(2) "-i"
["iface"]=>
NULL
["ttl"]=>
string(2) "-T"
["count"]=>
string(2) "-c"
["quiet"]=>
NULL
["size"]=>
string(2) "-s"
}
}
}
["type"]=>
string(2) "->"
["args"]=>
array(2) {
[0]=>
string(24) "execution of ping failed"
[1]=>
int(0)
}
}
[2]=>
array(7) {
["file"]=>
string(53) "PATH_TO_TEST/tping.php"
["line"]=>
int(13)
["function"]=>
string(4) "ping"
["class"]=>
string(8) "Net_Ping"
["object"]=>
object(Net_Ping)#1 (7) {
["_ping_path"]=>
string(9) "/bin/ping"
["_result"]=>
array(0) {
}
["_OS_Guess"]=>
string(0) ""
["_sysname"]=>
string(11) "linuxdebian"
["_args"]=>
array(1) {
["count"]=>
int(3)
}
["_noArgs"]=>
bool(false)
["_argRelation"]=>
array(12) {
["sunos"]=>
array(6) {
["timeout"]=>
NULL
["ttl"]=>
string(2) "-t"
["count"]=>
string(1) " "
["quiet"]=>
string(2) "-q"
["size"]=>
string(1) " "
["iface"]=>
string(2) "-i"
}
["freebsd"]=>
array(6) {
["timeout"]=>
string(2) "-t"
["ttl"]=>
string(2) "-m"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
NULL
["iface"]=>
NULL
}
["netbsd"]=>
array(6) {
["timeout"]=>
string(2) "-w"
["iface"]=>
string(2) "-I"
["ttl"]=>
string(2) "-T"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
}
["openbsd"]=>
array(6) {
["timeout"]=>
string(2) "-w"
["iface"]=>
string(2) "-I"
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
}
["darwin"]=>
array(6) {
["timeout"]=>
string(2) "-t"
["iface"]=>
NULL
["ttl"]=>
NULL
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
NULL
}
["linux"]=>
array(7) {
["timeout"]=>
string(2) "-W"
["iface"]=>
NULL
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
["deadline"]=>
string(2) "-w"
}
["linuxdebian"]=>
array(7) {
["timeout"]=>
string(2) "-W"
["iface"]=>
NULL
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
["deadline"]=>
string(2) "-w"
}
["linuxredhat8"]=>
array(7) {
["timeout"]=>
NULL
["iface"]=>
string(2) "-I"
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
["deadline"]=>
string(2) "-w"
}
["linuxredhat9"]=>
array(7) {
["timeout"]=>
string(2) "-W"
["iface"]=>
string(2) "-I"
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-c"
["quiet"]=>
string(2) "-q"
["size"]=>
string(2) "-s"
["deadline"]=>
string(2) "-w"
}
["windows"]=>
array(6) {
["timeout"]=>
string(2) "-w"
["iface"]=>
NULL
["ttl"]=>
string(2) "-i"
["count"]=>
string(2) "-n"
["quiet"]=>
NULL
["size"]=>
string(2) "-l"
}
["hpux"]=>
array(6) {
["timeout"]=>
NULL
["iface"]=>
NULL
["ttl"]=>
string(2) "-t"
["count"]=>
string(2) "-n"
["quiet"]=>
NULL
["size"]=>
string(1) " "
}
["aix"]=>
array(6) {
["timeout"]=>
string(2) "-i"
["iface"]=>
NULL
["ttl"]=>
string(2) "-T"
["count"]=>
string(2) "-c"
["quiet"]=>
NULL
["size"]=>
string(2) "-s"
}
}
}
["type"]=>
string(2) "->"
["args"]=>
array(1) {
[0]=>
string(11) "192.0.32.10"
}
}
[3]=>
array(4) {
["file"]=>
string(53) "PATH_TO_TEST/tping.php"
["line"]=>
int(20)
["function"]=>
string(9) "exec_ping"
["args"]=>
array(1) {
[0]=>
&string(11) "192.0.32.10"
}
}
}
["callback"]=>
NULL
}
Please, let me know if you need any more info about it.
Cheers.
- -- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.32.8 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages php-net-ping depends on:
ii php-pear 5.3.1-4 PEAR - PHP Extension and Applicati
php-net-ping recommends no packages.
php-net-ping suggests no packages.
- -- no debconf information
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iQIcBAEBCAAGBQJLfowUAAoJEPyEGy2CyLcRfRcQALW98pqjxm1YRKmaaz6ExCKj
uDiCmZ4EHB1IMnB4lgNHLABKJGv+6jv70nNghFUREpuk1CGxU+bTpw12H5uvrZ0z
zxMsA9ECFD+PVxQKdAvs6ExPzirjxL/DQqGefwzeF6rAv0otMEKlJxSrTduLrUQR
L+AL5BggAURgUhFQKer1klQTHpbvO6GpLrTKz4IlPEGv7/GUqd1EbChtZwFqqWZF
zH/svbPhjd7nr6RbKKc4eUR3hADLPI0LltD9+zrsc9N7I9rmhNq3pEzEu93onp5I
P8gu21HqhZJr4JCjW9siPW+3KFa3OR0XFmpyyl7apzOqHkFxwVVf1aribfRO6UUl
DnEYuebEsLmlnQVLmwpYtyVItPNDmg1lihgUfT/Z2hECzg/PBiJGiV2n1hDuvO5E
EXee77vT6JbwfP6qAN8e8mWZTmizCPS8V4LMwIFQS1d80zF2Dj1QfACNSks+w9Mm
BDA9VDXMtPtIhWgMTS2FZZx3kMGV4aYB2ntKKQFiwHuceu73H1EFD1ZyC9oR9qs3
jNB+ohlSwqhCJZEV+F0iocg/TrzpecrzsFXnKN1LVnnSr2JUwgG55PisSC4ua5lO
b1GO2YHZmAIGVjgarQXUH7jsZ3pGwAbcu6+4gCZk8aNguJvsFB1jVZSf71SQV1Hy
/qHaLIprIVPlvknNDyJ2
=Uxv0
-----END PGP SIGNATURE-----
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]