In Apache httpd.conf file I can set the DocumentRoot value. After setting this, if I view "localhost" in a browser, I can see the folders and files this given folder contains. I cannot "speak" PHP language well yet but I assume that all PHP activities in connection with files and folders are limited to the scope of localhost, so if I handle files with PHP they must be in the folder set as DocumentRoot (or in subfolders of it).

How can I set localhost's scope to a wider range, especially to other drives? My goal is to be able to handle files with PHP on my whole computer (it's a "locahost-only" project so it's not a must to be able to use it on "real" servers).


PHP can access any files any where within your computer if you give it the right access permission. You can use absolute paths when locating a file in PHP.

  • Thank you! What if I don't know the name of files/folders - I have found the answer here how to get the hierarchy of a directory in PHP: stackoverflow.com/questions/660644/…. But I want to scan not just a directory but my whole computer. So the question is that how can I read in the list of all partitions in PHP? – user3022924 Dec 24 '13 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.