How to find the full path to your server directory, using a PHP file
Sometimes you need to know the full path to a file or directory.
For example, if you wanted to setup .htaccess authentication, you'd need to enter the full path into the .htpasswd file. If you don't know the full path, and PHP is installed on the server, then you can easily have the server tell you the folder location! This small PHP script shows the full path of the file (the folder where the file is currently located on the server) when viewed in a browser PHP Code:
Code:
http://www.digitalFAQ.com/mytestfolder/pathtest.php Code:
/hosted/www/vhosts/mysite.com/subdomains/forum/httpdocs Windows will be in a standard D:\vhosts\mysite.com\etc sort of location. That's all you need. When finished, for security purposes, delete that test file. You don't want to freely give hackers information about your site or server structure. Hope that helps. :) |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.