根路径不适用于 php include [英] root path doesn't work with php include

查看:28
本文介绍了根路径不适用于 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"

解决方案是什么?

推荐答案

我假设根文件夹是指 Web 文档根,而不是文件系统根.

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')

这篇关于根路径不适用于 php include的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆