Find the Full Path To A Virtual Host Directory

This is a quick one, but hopefully some people will find it useful!

This simple script normally returns the full Linux path to your files, e.g.

/var/www/vhosts/leadingedgescripts.co.uk/httpdocs/

Simply create a PHP file with the following contents:

<?php

echo getcwd();

?>

Copy it to your PHP enabled server (using FTP/SFTP etc) and visit it in your web browser.

This tidbit of information can be very useful when configuring a website on a new server.

This entry was posted in Server Administration, Web Development and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*