#24491 [Fbk->Csd]: Net_ping Operation not permitted
| From: | ohill@php.net | Date: | Sun, 06 Jul 2003 17:10:27 +0000 |
| Subject: | #24491 [Fbk->Csd]: Net_ping Operation not permitted | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-18053@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: Feedback
+Status: Closed
Bug Type: PEAR related
Operating System: FreeBSD 4.8Rc1
PHP Version: 4.3.1
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
The correct OS detection is now present in the CVS version.
Previous Comments:
------------------------------------------------------------------------
[2003-07-04 21:50:17] ohill@php.net
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
------------------------------------------------------------------------
[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