【发布时间】:2012-07-08 22:53:21
【问题描述】:
当一切正常时,我已经像以前一样创建了超级简单的脚本。但不知何故,它停止了,现在每次我尝试要求一个文件时,它都会向我显示一个错误:
致命错误:require_once():在 E:\tools 中打开所需的 'E:\tools\EasyPHP\www/registry/registry.class.php' (include_path='.;C:\php\pear') 失败\EasyPHP\www\index.php 第 18 行
我的索引文件:
define("APP_PATH", dirname(__FILE__)."/");
require_once(APP_PATH.'registry/registry.class.php');
就是这样,但我仍然无法加载该页面。
我应该如何设置它?我只使用 Windows 进行本地构建。
【问题讨论】:
-
file_exists(APP_PATH.'registry/registry.class.php') 给出?如果为假,则检查 APP_PATH.'registry/registry.class.php' 与预期的文件路径
-
可能是愚蠢的问题,但
E:\tools\EasyPHP\www/registry/registry.class.php存在吗? -
是的,但告诉我它甚至不存在。
-
好的,我已经解决了这个问题。 Dreamweaver 将文件命名为“registry.class.php.php”,这可能是我的错,我没有注意到这一点。当我重新创建文件时,它开始正常工作。无论如何使用 directory_separator 比单斜杠更好。
标签: php fatal-error require-once