根路径不适用于php include [英] root path doesn't work with php include
本文介绍了根路径不适用于php include的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
/在获取到根文件夹的链接的开头在php include中不起作用。
/ in the beginning of a link to get to the root folder doesn't work in php include.
例如/example/example.php
for example "/example/example.php"
解决方案是什么?
推荐答案
我假设是root用户文件夹你的意思是你的web文档根目录,而不是文件系统root。
I'm assuming by root folder you mean your web document root, rather than filesystem root.
为此,你可以
- 将web根文件夹添加到包含路径,
include('example / example.php')
- 或者你可以
include($ _ SERVER ['DOCUMENT_ROOT']。'/ example / example.php')
- add the web root folder to the include path, and
include('example/example.php')
- or you can
include($_SERVER['DOCUMENT_ROOT'].'/example/example.php')
这篇关于根路径不适用于php include的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文