文件结构(仅供参考,我在 linux 服务器上)
错误:
Warning: include(./Setup/Setup.php) [function.include]: failed to open stream: No such file or directory in /home/content/22/10350022/html/templates/Home.php on line 1
Warning: include() [function.include]: Failed opening './Setup/Setup.php' for inclusion (include_path='.:/usr/local/php5_3/lib/php') in /home/content/22/10350022/html/templates/Home.php on line 1
我尝试了几种不同的方法来访问此设置文件。
tried: include('/Setup/Setup.php') - same error
tried: __DIR__. '/Setup/Setup.php'
tried: $_SERVER [SITEROOT] and some other variations including the total path.
tried: Include = path ".:/Setup/Setup.php"
这三个都产生了相同的错误,但有一个区别。错误中显示的路径包括:/var/chroot/home/.../Setup/Setup.php
我很难理解这里发生了什么。我对 PHP 不是很精通,所以我不确定如何最小化相对路径和绝对路径。
当我告诉它在 /Setup 中查找时,为什么它在我的 /templates 文件夹中查找?
谢谢!