gpt4 book ai didi

php - 如何清除此错误

转载 作者:太空宇宙 更新时间:2023-11-03 23:49:49 25 4
gpt4 key购买 nike

我在下面使用了将 PPT 转换为 IMG 的代码

<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?php

$ppApp = new COM("PowerPoint.Application");
$ppApp->Visible = True;
$strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"])));
$FileName = "MyPP";
$ppName = "MySlides.ppt";


//*** Open Document ***//
$ppApp->Presentations->Open(realpath($ppName));

//*** Save Document ***//
$ppApp->ActivePresentation->SaveAs($strPath."/".$FileName,17); //'*** 18=PNG, 19=BMP **'
//$ppApp->ActivePresentation->SaveAs(realpath($FileName),17);

$ppApp->Quit;
$ppApp = null;
?>
PowerPoint Created to Folder <b><?php $FileName?></b>
</body>
</html>

当使用 xamp 在我的本地系统中运行此代码时,它仅在 http://localhost 中工作,但如果我在我的网络服务器(cpanel 托管位置)位置中使用相同的代码,它会显示以下错误:

Fatal error: Class 'COM' not found in /home/domainname/public_html/index.php on line 9

最佳答案

PHP 手册状态..

As of PHP 5.3.15 / 5.4.5, this(COM) extension requires php_com_dotnet.dll to be enabled inside of php.ini in order to use these functions.

Installation Doc from PHP Manual

关于php - 如何清除此错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20486575/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com