<?php
// $Rev: 129 $
//error_reporting(E_ALL);
foreach (new DirectoryIterator(getcwd()) as $entry) {
if ($entry->isFile() && strpos($entry, '_testcase.')>0) {
echo basename($entry);
require_once($entry);
echo '<br>...pass!<br><br>';
}
}
?>这样一段代码。在一个cms里看到的。 为什么访问的时候会报错
element_testcase.php Warning: require_once(../../simple_html_dom_reader.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\web\inc\simplehtmldom_1_5\testcase\reader\element_testcase.php on line 6 Fatal error: require_once(): Failed opening required '../../simple_html_dom_reader.php' (include_path='.;C:\php\pear') in C:\inetpub\wwwroot\web\inc\simplehtmldom_1_5\testcase\reader\element_testcase.php on line 6
我的意思是报错。。说明有值,但是这个页面没调用别的文件,而且 DirectoryIterator这个类和getcwd()这个函数,我全文搜索都找不到。
在说明一下,把上面的代码复制,新建一个php文件,在访问,就是空了,,这是为什么呢???
<?php
// $Rev: 129 $
//error_reporting(E_ALL);
foreach (new DirectoryIterator(getcwd()) as $entry) {
if ($entry->isFile() && strpos($entry, '_testcase.')>0) {
echo basename($entry);
require_once($entry);
echo '<br>...pass!<br><br>';
}
}
?>这样一段代码。在一个cms里看到的。 为什么访问的时候会报错
element_testcase.php Warning: require_once(../../simple_html_dom_reader.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\web\inc\simplehtmldom_1_5\testcase\reader\element_testcase.php on line 6 Fatal error: require_once(): Failed opening required '../../simple_html_dom_reader.php' (include_path='.;C:\php\pear') in C:\inetpub\wwwroot\web\inc\simplehtmldom_1_5\testcase\reader\element_testcase.php on line 6
我的意思是报错。。说明有值,但是这个页面没调用别的文件,而且 DirectoryIterator这个类和getcwd()这个函数,我全文搜索都找不到。
在说明一下,把上面的代码复制,新建一个php文件,在访问,就是空了,,这是为什么呢???
说明:我不知道这个系统还能用到什么地方!他的运作方式是这样的,客户在其他地方比如掏宝购买了 你得卡,然后在你的网站进行冲值,你得有人登陆并看着后台,如果有人冲值,就会刷出记录,手工冲值完毕后,你得点击 [冲值完毕],客户的页面 就会返回 冲值信息!安装:上传所有文件,倒入(sql.txt)mysql数据库,使用myphpadminphplib 777phplib/sys.php 777phplib
0
这个报错是在告诉你 simple_html_dom_reader.php 无法加载,你应该检查require_once是不是路径有问题,或者文件是否已经删除
DirectoryIterator 是PHP的内建类,请看 http://php.net/manual/zh/class.directoryiterator.php 用于对目录的迭代,getcwd是获取当前工作目录,PHP内建方法
其实这个时候你用xdebug单步调一下或者运行个跟踪分分钟就知道问题出在哪里。。。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号