文件結構(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'。 –