致命错误:带有消息的未捕获异常'com_exception'.同时将ppt转换为jpg

Rav*_*rma 9 php powerpoint jpeg

当我运行吹码时:

/*** PPT to Image conversion ***/
$ppt_file = 'E:\wamp\www\temp/a.pptx';
$app = new COM("PowerPoint.application") or die("Unable to instantiate PowerPoint");
$app->Visible = true;
$app->Presentations->Open($ppt_file); 
$app->Presentations[1]->SaveAs("E:/tmp/outdir",18);
$app->Presentations[1]->Close();
$app->Quit();
$app = null; 
Run Code Online (Sandbox Code Playgroud)

它给了我一个例外:

致命错误:未捕获的异常'com_exception',消息' 来源: Microsoft Office PowerPoint 2007
说明: PowerPoint无法打开该文件.' 在E:\ wamp\www\temp\_ video_conversion.php:107堆栈跟踪:#0 E:\ wamp\www\temp\video_conversion.php(107):variant-> Open('E:\ wamp\www\tem ......')在第107行的E:\ wamp\www\temp\video_conversion.php中抛出#1 {main}

我无法弄清楚问题是什么.

Joh*_*ano 4

这种问题是由以下因素造成的。

  1. PHP.ini 设置
  2. 文件夹权限
  3. 服务器中未启用允许打开
  4. 允许上传大小