文件结构(FYI我的Linux服务器上)没有包括PHP的错误:尽管使用绝对和相对错误的目录中查找包括
错误:
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,所以我不确定如何微调相对与绝对路径。
为什么当我告诉它在/安装程序中查看我的/ templates文件夹?
谢谢!
此脚本在哪个目录中,以及要包含在哪个目录中?例如它们的绝对路径是什么,'/ path/to/the script.php'和'/ some/other/path/to/the/include/file.php'。 –