Home / Code Snippets / PHP / Find the Full Path to a File Find the Full Path to a File Author Chris Coyier Comments Start the Conversation Published Sep 25, 2009 Updated Sep 25, 2009 Share this:TwitterFacebook monday.com helps you manage your projects. <?php echo dirname(__FILE__); ?> Save the file as fullpath.php Upload to the folder you'd like to know the full path to Go to http://www.yoursite/lots/of/folders/fullpath.php You'd might be surprised what shows up. Sometimes you need more than just /lots/of/folders/ as your full path to a file (e.g. .htpasswd). This script will allow you to see that.