How can we access the Folders out side the Web root Directory?
We are using WAMPSERVER 2.0 (Apache 2.2.11,php 5.3.0 & My Sql 5.1.36).
usr
| - www
|- docs
|- A
|- webroot
|- index.php
Just use "normal" file paths. Eg to access A
in the docs
folder from index.php
, you can use relative paths like ../docs/A
or absolute paths like /usr/www/docs/A
.
The "webroot" directory only marks the entry point for URLs . This has no effect on PHP files. They are just normal files in a filesystem and can therefore access other files in the system via ordinary file paths.
我认为您只需要学习如何在php中读取目录http://www.webcheatsheet.com/PHP/working_with_directories.php
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.