I can\'t believe PHP doesn\'t have an easy solution for this simple matter. ASP.NET has a ~ sign that takes care of this issue and starts everything from the root level. Her
You can access the $_SERVER['DOCUMENT_ROOT'] variable :