Fatal error: Class 'COM' not found in MAMP

旧巷老猫 提交于 2019-12-13 21:17:32

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/11704262/fatal-error-class-com-not-found-in-mamp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!