How to identify server IP address in PHP May 21, 2023 by Tarik Like this for the server ip: $_SERVER['SERVER_ADDR']; and this for the port $_SERVER['SERVER_PORT'];