|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
30 + 39 = ?
Subscribe to this entry?

 [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 19:03:34 2022 UTC