php错误:Uncaught exception com_exception with message Failed to create COM object

Posted caigan的技术博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php错误:Uncaught exception com_exception with message Failed to create COM object相关的知识,希望对你有一定的参考价值。

本文为大家讲解的是php错误:Uncaught exception com_exception with message Failed to create COM object,感兴趣的同学参考下.

错误:

Fatal error: Uncaught exception ‘com_exception‘ with message ‘Failed to create COM object `InternetExplorer.Application‘: 拒绝访问
在PHP中调用IE使用如下代码:


browser = new COM("InternetExplorer.Application");


无法正常调用,直接报错:


Fatal error: Uncaught exception ‘com_exception‘ with message ‘Failed to create COM object `InternetExplorer.Application‘: 拒绝访问。


原因是IE的COM组件默认禁止普通帐号访问,解决方法如下:
1、打开控制面板 - 管理工具 - 组件服务
2、在组件服务面板中依次打开 控制台根目录 - 组件服务 - 计算机 - 我的电脑 - DCOM 配置(如下图)
技术分享
3、在右边窗口中找到 Internet Explorer(Ver 1.0) 打开属性窗口,切换到安全标签

4、安全标签中“启动和激活权限”选择自定义,编辑,添加网站使用的IIS帐号或添加 Guests组 确定即可(如下图)。
技术分享
5、重起IIS,现在应该可以正常调用IE了。

 














以上是关于php错误:Uncaught exception com_exception with message Failed to create COM object的主要内容,如果未能解决你的问题,请参考以下文章

Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or d

黑莓 8320 uncaught exception

ERROR Utils: Uncaught exception in thread stdout writer for python

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: xxxx

iOS Terminating app due to uncaught exception 'NSInternalInconsistencyException', re

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewCon