Maison  >  Article  >  développement back-end  >  Uncaught exception com_exception with message Failed to crea_PHP教程

Uncaught exception com_exception with message Failed to crea_PHP教程

WBOY
WBOYoriginal
2016-07-21 15:21:16764parcourir

在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 配置(如下图)
Uncaught exception com_exception with message Failed to crea_PHP教程
3、在右边窗口中找到 Internet Explorer(Ver 1.0) 打开属性窗口,切换到安全标签

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

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/324953.htmlTechArticle在PHP中调用IE使用如下代码: 复制代码 代码如下: browser = new COM("InternetExplorer.Application"); 无法正常调用,直接报错: 复制代码 代码如下:...
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn