I use the php file in attachments. Just upload in a directory or subdirectory where you want the path. Then access whereami.php file in your browser. Very simple and efficient
Since all of you like simple scripts look at this another attachment. It's the phpinfo.php file; just upload to the server and access with your favorite browser. You will have a complet list of all parameters and installations available on the server. It would be helpful if you work for a client in his hosting service.