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