PHP组件对象模型“访问被拒绝” [英] PHP Component Object Model "Access is denied"

查看:245
本文介绍了PHP组件对象模型“访问被拒绝”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的开发环境是PHP 5.3,IIS 7.5和Window7 Home。我正在开发一个原型应用程序,它需要PHP函数imagewindowgrab()。这个函数需要调用Windows组件对象模型(COM)。

My development environment is PHP 5.3, IIS 7.5, and Window7 Home. I am developing a prototype application, which requires the PHP function imagewindowgrab(). This function requires calling the Windows Component Object Model (COM).

我的单行代码是:



$browser = new COM("InternetExplorer.Application") or die("Unable to instantiate IE");

产生以下错误:



Fatal error: Uncaught exception 'com_exception' with message 
'Failed to create COM object `InternetExplorer.Application': Access is denied. ' 
in C:\inetpub\wwwroot\trial.php:8 Stack trace: #0 C:\inetpub\wwwroot\trial.php(8): com->com('InternetExplore...') #1 {main} thrown 
in C:\inetpub\wwwroot\trial.php on line 8

搜索小时后,通过.NET论坛浏览,找到好的资源:

After searching for hours, trolling through .NET forums, and finding good resources:

  • http://forums.asp.net/t/1680634.aspx/1
  • http://learn.iis.net/page.aspx/624/application-pool-identities/

最后工作对我来说,是按照这个SO问题的答案中列出的说明:

What finally worked for me was following the instructions outlined in the answer to this SO question:
Accessing Office Word object model through asp.net results in "failed due to the following error: 80070005 Access is denied."

并按照以下说明操作:


  1. 在命令行请输入 DCOMCNFG

  2. 点击控制台根>组件服务>计算机>我的电脑,然后选择属性

  3. COM安全>访问权限选项卡上点击编辑默认 IIS_IUSRS )或服务

  4. 检查允许本地访问

  1. On the command line enter DCOMCNFG
  2. Click right on Console Root > Component Service > Computers > My Computer and select Properties
  3. On the tab COM Security > Access Permissions click on Edit Default and add the user (e.g. IIS_IUSRS) or service
  4. Check allow local access

推荐答案

这个问题似乎没有回答,但回答有自我解释有问题。
我只是在这里: -

This question appears unanswered but answer have self explained in question . I am just putting here :-

试用代码:

$browser = new COM("InternetExplorer.Application") or die("Unable to instantiate IE");

生成错误:

Fatal error: Uncaught exception 'com_exception' with message 
'Failed to create COM object `InternetExplorer.Application': Access is denied. ' 
in C:\inetpub\wwwroot\trial.php:8 Stack trace: #0 C:\inetpub\wwwroot\trial.php(8): com->com('InternetExplore...') #1 {main} thrown 
in C:\inetpub\wwwroot\trial.php on line 8

有助于解决的步骤和资源:

好资源: -

http://forums.asp.net /t/1680634.aspx/1

http://learn.iis.net/page.aspx/624/application-pool-identities/

实际有助于解决的资源: -

Resources that actually help to solve :-

Accessing Office Word object model through asp.net results in "failed due to the following error: 80070005 Access is denied."

步骤: -


  1. 命令行输入DCOMCNFG

  2. 在控制台根目录>组件服务>计算机>我的电脑上单击右键,然后选择属性

  3. >访问权限单击编辑默认
    添加用户(例如。 IIS_IUSRS)或服务

  4. 选中允许本地访问

  1. In the line of command put DCOMCNFG
  2. Click Right on Console Root > Component Service > Computers > My Computer, And Select Properties
  3. In the Tab COM Security > Access Permissions Click in Edit Default Add the User (Ex. IIS_IUSRS) or service
  4. Check Allow Local Access

注意:从PHP访问COM框架的权限问题。

这篇关于PHP组件对象模型“访问被拒绝”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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