【发布时间】:2011-04-26 15:56:24
【问题描述】:
大家好, 我在这里误会了什么?
$dir = get_bloginfo('template_url').'/images/headers/';
echo $dir;
//ouput: myblog.com/wp-content/themes/mytheme/images/headers
$dir = new DirectoryIterator(get_bloginfo('template_url').'/images/headers/');
echo $dir;
//output: nothing at all! blank page!
控制台输出一个致命错误:
[2011 年 4 月 26 日] PHP 致命错误: 未捕获的异常'RuntimeException' 带消息 'DirectoryIterator::__construct(http://myblog.com/wp-content/themes/mytheme/images/headers/) [目录迭代器。--构造]: 无法打开目录:未实施' 在 /Users/myname/htdocs/myblog.com/wp-content/themes/mytheme/inc/header-image.php:3 堆栈跟踪:
0 /Users/myname/htdocs/myblog.com/wp-content/themes/mytheme/inc/header-image.php(3):
DirectoryIterator->__construct('http://oberperf...')
1 /Users/myname/htdocs/myblog.com/wp-content/themes/mytheme/header.php(69):
include('/Users/myname...')
2 /Users/myname/htdocs/myblog.com/wp-includes/theme.php(1112):
require_once('/Users/myname...')
3 /Users/myname/htdocs/myblog.com/wp-includes/theme.php(1088):
load_template('/Users/myname...', 真的)
4 /Users/myname/htdocs/myblog.com/wp-includes/general-template.php(34):
locate_template(数组,真)
5 /Users/myname 在 /Users/myname/htdocs/myblog.com/wp-content/themes/mytheme/inc/header-image.php
在第 3 行
知道这里出了什么问题吗?
【问题讨论】:
标签: php path iterator directory