Home / Code Snippets / PHP / Find the Full Path to a File Author Chris Coyier Comments Start Conversation Published Sep 25, 2009 200+ popular business app integrations on MailChimp. <?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.