Req #17400 [Opn]: getting ip for eth0
| From: | ab@php.net | Date: | Tue, 05 Nov 2013 08:20:50 +0000 |
| Subject: | Req #17400 [Opn]: getting ip for eth0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182601@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=17400&edit=1
ID: 17400
Updated by: ab@php.net
Reported by: e at arix dot com
Summary: getting ip for eth0
Status: Open
Type: Feature/Change Request
Package: *General Issues
PHP Version: 4.2.1
-Assigned To:
+Assigned To: ab
Block user comment: N
Private report: N
New Comment:
gonna do the windows part
Previous Comments:
------------------------------------------------------------------------
[2013-10-27 12:47:33] krakjoe@php.net
Oh I forgot to mention, we can provide some of the information you requested in a portable (across
posix implementations) way.
It's not so easy to provide RX/TX counters and status.
Providing proper names and addresses should allow you to write the non-portable stuff for the
platform you are targeting, in php ...
------------------------------------------------------------------------
[2013-10-27 12:42:45] krakjoe@php.net
Because _nobody_ should have to wait more than a decade for a decent answer:
https://gist.github.com/krakjoe/7181349
Not able to attach patch to bug, will do when systems are fixed ... stupid hackers ...
Who is gonna do windows ??
------------------------------------------------------------------------
[2002-05-24 02:22:59] derick@php.net
reclassify as feature request
------------------------------------------------------------------------
[2002-05-24 00:37:55] mfischer@php.net
If you can think of a cross-platform way ... which I doubt.
Just execute /sbin/ifconfig and parse it's output.
------------------------------------------------------------------------
[2002-05-23 20:29:51] e at arix dot com
I'd like to request a function to retrieve the IP address(es) of a given network interface...
something that would let me:
$ip = ifaddr("eth0");
maybe even something more general like:
$info = ifconfig("eth0")
echo $info["HWAddr"], $info["Mask"];
echo $info["RX-packets"], $info["RX-errors"],
etc.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=17400&edit=1