Fatal error: Class 'COM' not found in MAMP

2019-09-08 05:25发布

I am facing this issue

Fatal error: Class 'COM' not found in /Applications/MAMP/htdocs/ctor/abc.php on line 10

the abc.php is as follows

<?php
ini_set ( 'max_execution_time', 300);

$filename = "abc.xlsx";

$sheet1 = 4;

$arr=array(1=>'a','b','c','d');

$excel_app = new COM("Excel.application") or Die ("Did not connect");

?>

please suggest some solution.

标签: php com mamp
1条回答
你好瞎i
2楼-- · 2019-09-08 06:01

COM is available on Windows only.

Deducting from the "MAMP" in your path, you seem to be on an Apple Machine. Mac OS is Unix based.

查看更多
登录 后发表回答