【发布时间】:2017-09-28 13:35:06
【问题描述】:
这是我的项目结构:
Web 根目录/文档根目录:
/var/www/ all the website files in the the 'www' folder
我想使用require 或include 在网络根目录/文档根目录之外的文件夹中的文件:
/var/extra-files
如何使用require 或include 在extra-files 文件夹中获取文件?
require "OUTSIDE DOCUMENT ROOT/extra-files
谢谢
【问题讨论】:
-
使用该文件的完整路径,例如
require_once '/var/extra-files/somefile.php'.
标签: php apache ubuntu directory document-root