这是由于创建(临时)文件后,进行编辑、输出等操作后,文件在后台默认还是开启的状态。 所以需要先引用fclose($filename)方法将文件关闭后 $tmpfile = '文件路径'; $filename= fopen($tmpfile,"r"); fclose($filename);