我工作的一个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中进行任何配置? –