我的配置文件如下所示:
<?php
define('ROOT_DIR', dirname(_FILE_));
?>
然后我的html:
<?php
require_once ('../../../../config.php'); // back to app root
?>
<?php
$pageTitle = 'title';
require_once(ROOT_DIR.'includes/content.php');
?>
我知道我的配置文件正在加载,因为我可以在查看源代码时看到我的配置注释。
但是,否则我只会得到一个空白页。有人告诉我我做错了什么吗?
编辑:
错误报告产量
Warning: require_once(./includes/content.php) [function.require-once]: failed to open stream: No such file or directory in /Applications/MAMP/html/BLX2012/prototypes/19/demo.16/events/2013/PIC/LasVegas/index.php on line 10
Fatal error: require_once() [function.require]: Failed opening required './includes/content.php' (include_path='.:/Applications/MAMP/bin/php/php5.3.6/lib/php') in /Applications/MAMP/html/BLX2012/prototypes/19/demo.16/events/2013/PIC/LasVegas/index.php on line 10
[对不起,我希望以上内容更具可读性]