无法在PHP目录中看到文件

时间:2013-01-09 12:17:11

标签: php wordpress wordpress-plugin file-handling

我通过像这样的文件处理在我的服务器上保存文件

$my_file = $_SERVER['DOCUMENT_ROOT'].'/wp-content/themes/mythemev2.0/'.$name.'.php';
echo $my_file;
$handle = fopen($my_file, 'w') or die('Cannot open file:  '.$my_file);

fwrite($handle, $res->name);

$my_file perfectly向我展示了文件的完整路径。但是当我转到特定目录时,我无法看到该文件。可能是什么错误?我还可以做什么调试?

1 个答案:

答案 0 :(得分:1)

确保在fwrite()

之后调用fclose()
相关问题