致命错误:在MAMP中找不到类“COM” [英] Fatal error: Class 'COM' not found in MAMP

查看:201
本文介绍了致命错误:在MAMP中找不到类“COM”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到此问题


致命错误:在/ Applications / MAMP / htdocs / ctor / abc中找不到类'COM' .php第10行

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

abc.php如下

<?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");

?>

请提出一些解决方案。

推荐答案

COM是仅适用于Windows。

从你的路径中的MAMP中扣除,你似乎是在一台Apple机器上。 Mac OS是基于Unix的。

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

这篇关于致命错误:在MAMP中找不到类“COM”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆