|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24491 Net_ping Operation not permitted
Submitted: 2003-07-03 22:37 UTC Modified: 2003-07-06 12:10 UTC
From: ad1 at poorman dot org Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.3.1 OS: FreeBSD 4.8Rc1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ad1 at poorman dot org
New email:
PHP Version: OS:


 [2003-07-03 22:37 UTC] ad1 at poorman dot org
PEAR/Net_Ping don't implement right argument.

require_once 'Net/Ping.php' ;
$ping = new Net_Ping;
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"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-04 21:50 UTC]
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!

 [2003-07-06 12:10 UTC]
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
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the 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.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jan 17 20:03:35 2022 UTC