3

I run raspberry with a strating webbrowser in kiosk mode and want to display the local ip-adress of my raspberry.

How can I do this? I Use PHP (httpd) I tried with

<?php print_r($SERVER); ?>

but this will give me only 127.0.0.1

I want the same output like

sudo ip addr show 

output:

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b8:27:eb:7c:ce:18 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.28/24 brd 192.168.0.255 scope global eth0

Any ideas?

Ghanima
  • 15,958
  • 17
  • 65
  • 125
s3bi
  • 160
  • 1
  • 2
  • 7

1 Answers1

4

This works for me

<?php system("hostname -I"); ?>
Steve Robillard
  • 34,988
  • 18
  • 106
  • 110
user10366
  • 56
  • 1