您的位置:首页 > 编程语言 > PHP开发

php实现word转html文档卡死的问题

2015-10-16 17:13 741 查看
在执行php上传转换word为html时,时常会卡死,文件上传不上去

function word2html($wordname,$htmlname)
{
$word = new COM("word.application") or die("Unable to instanciate Word");
$word->Visible = 1;
$word->Documents->Open($wordname);
$word->Documents[1]->SaveAs($htmlname,8);
$word->Quit();
$word = null;
unset($word);
}

word2html('D:/www/test/6.docx','D:/www/test/6.html');


执行多次以后我发现是因为
$word->Documents->Open($wordname);
上面这句,遇到这种情况以后,需要的服务器端的任务管理器的进程服务中,关闭winword.exe进程,或者把文件改名,才能转换成功。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: