我工作的一個PHP項目,我得到的require_once錯誤(或者甚至需要)致命錯誤:require_once()(include_path中= '; C: PHP5 梨')
Warning: require_once(C:/wamp/www/MyFiles/MyProject/includes/db_config.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\MyFiles\MyProject\includes\autoloads.php on line 9
Fatal error: require_once() [function.require]: Failed opening required 'C:/wamp/www/MyFiles/MyProject/includes/db_config.php' (include_path='.;C:\php5\pear') in C:\wamp\www\MyFiles\MyProject\includes\autoloads.php on line 9
這就是我如何包括
$root = $_SERVER['DOCUMENT_ROOT'];
//config..
require_once($root . '/MyFiles/MyProject/includes/db_config.php');
我一直在使用
echo $root . '/MyFiles/MyProject/includes/db_config.php';
在打印網址正確
試圖文件即C:\wamp\www\MyFiles\MyProject\includes\db_config.php
我使用WAMP服務器5 autload.php和db_config.php都在同一個文件夾
你肯定**文件('db_config.php')在那個目的地嗎? – 2012-06-25 11:12:58
是的文件位於相同的路徑 –
我是否需要在PHP.ini中進行任何配置? –