from http://php.net/manual/en/reserved.variables.server.php :
"$_SERVER" is an array containing information such as headers, paths, and script locations. the entries in this array are created by the web server. " there is no guarantee that every web server will provide any of these, servers may omit some, or provide others not listed here. "
The three functions you have written, remote_addr etc. gives you the ip address of your server but this php compiler does not have any server, therefore this error is coming. If you placed same code on localhost or any other free online servers it will work.