0
需要一些帮助来解决此错误。新鲜的WordPress 2.9安装...致命错误:无法实例化不存在的类:directoryiterator
致命错误:无法实例不存在的类:directoryiterator在/home1/test/public_html/test2/wp-content/themes/mytheme/functions.php线471
function get_dirs($path = '.') {
$dirs = array();
foreach (new DirectoryIterator($path) as $file) { //THIS IS LINE 471
if ($file->isDir() && !$file->isDot()) {
$dirs[] = $file->getFilename();
}
}
return $dirs;
}
我想这可能是罪魁祸首。它在wordpress的共享服务器上安装。我如何通过脚本查询PHP版本? – 2009-12-23 15:18:14
假设它的版本4,我可以将该类添加到实用程序文件中吗? – 2009-12-23 15:18:55
嗯,我想你会需要一个自定义的实现。 *您自担风险*,这是谷歌发现的例子:http://www.weberdev.com/get_example-4180.html – catchmeifyoutry 2009-12-23 15:23:04