Root Path and Configuration of your Website using php

Display the root path and configuration of your website by uploading a php file to your website.

There’s times when you need to know the root path of a website as well as all of the configuration details of that server. This is actually very simple, we’ll explain how…

Root path of your site

Open a plain text editor and enter the following:

<?= $_SERVER['DOCUMENT_ROOT'];?>

Then save this with a .php extension i.e. root-path.php and upload to the root of your site via FTP. Then type in the url to that file and you’ll see the root path of your home directory.

Configuration details of your site

Find out if your server runs php and all of the configuration details of the server by opening a plain text editor and type the following:

<?php phpinfo();?>

Save the file with a .php extension i.e. config-details.php and upload to the root of your site. Type in the url in your web browser and all of the server config details are there to see.

Note: For security reasons, do not leave this file there permanently.

If you’ve found this useful please leave a comment below.

One reply on “Root Path and Configuration of your Website using php

  1. Avatar for Me Me says:

    Doesn’t work.

Leave a Reply

Your email address will not be published. Required fields are marked *