#24491 [Opn->Fbk]: Net_ping Operation not permitted
| From: | ohill@php.net | Date: | Sat, 05 Jul 2003 02:50:18 +0000 |
| Subject: | #24491 [Opn->Fbk]: Net_ping Operation not permitted | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-18017@lists.php.net to get a copy of this message | ||
ID: 24491
Updated by: ohill@php.net
Reported By: ad1 at poorman dot org
-Status: Open
+Status: Feedback
Bug Type: PEAR related
Operating System: FreeBSD 4.8Rc1
PHP Version: 4.3.1
New Comment:
This seems to be a problem with the ping utility that comes with
FreeBSD.
This ping requires a different set of arguments. The -w option is
replaced by a -t one for defining a "timeout" to wait.
As for the permissions, FreeBSD seems to prohibit a custom packet size
from normal users. A quick fix would be to replace this line:
$cmd = $this->ping_path." $q -c $counts -s $packet_size -w $maxwait
$host";
With this one in the package:
$cmd = $this->ping_path." $q -c $counts -t $maxwait $host";
Note that this will work only while using FreeBSD!
Oliver
Previous Comments:
------------------------------------------------------------------------
[2003-07-03 22:37:08] ad1 at poorman dot org
Description:
------------
PEAR/Net_Ping don't implement right argument.
<?php
require_once 'Net/Ping.php' ;
$ping = new Net_Ping;
var_dump($ping->ping("168.95.1.1"));
?>
when I run in FreeBSD 4.8. user ROOT it return
"
ping: illegal option -- w
usage: ping [-AQRadfnqrv] [-c count] [-i wait] [-l preload] [-m ttl]
[-p pattern] [-P policy] [-s packetsize] [-S src_addr] [-t
timeout]
[host | [-L] [-I iface] [-T ttl] mcast-group]
string(14) "HOST_NOT_FOUND"
"
when I run use user account , it return
"
ping: -s flag: Operation not permitted
string(14) "HOST_NOT_FOUND"
"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24491&edit=1