中的文件這是我的目錄:包括包含的文件
global.php
includes
class_bootstrap.php
resourcemanager
index.php
要在index.php文件global.php,我有:
require_once('../global.php');
而且在global.php,我有:
require_once(./includes/class_bootstrap.php);
在運行時的index.php,我得到這個消息:
Warning: require_once(./includes/class_bootstrap.php): failed to open stream: No such file or directory in C:\xampp\htdocs\yurivn\global.php on line 15
Fatal error: require_once(): Failed opening required './includes/class_bootstrap.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\yurivn\global.php on line 15
我不知道如果在錯誤的目錄中的文件class_bootstrap.php PHP搜索,它可以搜索「的ResourceManager /包括/ class_bootstrap.php」的代替「包括/ class_bootstrap.php」,因爲如果我把index.php到與global.php相同的目錄,它完美的作品。
反正有使ResourceManager的目錄的index.php工作,而在global.php或class_bootstrap.php改變什麼嗎?我只是寫一些插件,我不想改變任何屬於開發人員的東西。
這是完整的錯誤信息,因爲我記得在「沒有這樣的文件或目錄」之後有完整的路徑被使用。 – Samuel
對不起,我只是編輯了我的問題。 – Mee
嘗試使用'dirname(__ FILE __)'或檢查:http://stackoverflow.com/questions/5610248/include-an-php-file-with-included-files –