PHP Code to Display Server IP Address

Use the following code if you want to display Server IP Address. Simply copy the code in text file & save as .php file in the server.

For Linux with Apache/Litespeed Server use

<?php
echo $_SERVER['SERVER_ADDR'];
?>

For Windows 2008 R2 with IIS 7.5 Server use

<?php
echo $_SERVER['LOCAL_ADDR'];
?>


0 comments… add one

Leave a Comment