代码之家  ›  专栏  ›  技术社区  ›  carl

致命错误:在第13行的E:\Server\wwwroot\PHPWebAdmin\initialize.php中找不到类“COM”

  •  2
  • carl  · 技术社区  · 14 年前

    我正在努力建立 hMailServer(电子邮件服务器) 在“Windows Server 2008 Enterprise Edition Service Pack 1”中。我已经成功地安装了hMailServer、Apache、PHP和webmail接口“AfterLogic webmail”。所有这些都运行良好。但我在尝试安装时遇到了问题 PHPWeb管理员 ” 错误消息如下:

    Fatal error: Class 'COM' not found in E:\Server\wwwroot\PHPWebAdmin\initialize.php on line 13
    

    此信息出现在访问时“http://192.168.2.66:8088/PHPWebadmin/”。

    我已经配置了PHP配置文件 php.ini文件 选项如下:

    [PHP]
    register_globals = Off
    display_errors = Off
    
    doc_root = "E:/Server/wwwroot"
    extension_dir = "E:/Server/php5_4_5/ext"
    
    [Session]
    session.save_path = "E:/Server/php5_4_5/tmp"
    
    [COM]
    com.allow_dcom = true
    

    我还按照hMailServer手册的建议完成了这些工作:

    DCOM permissions
    Overview
    By default, IIS6 is not allowed to connect to hMailServer because of the Distributed COM permissions that Windows uses. Also, Apache run as a user account with restricted permissions is not allowed to connect by default.
    
    Steps
    Follow these steps to give IIS or Apache the required permissions to connect to hMailServer using DCOM.
    
    1.Start DCOM config by selecting Start, Run, enter dcomcnfg.exe and press OK. 
    2.In the Component Services program, expand the Component Services folder 
    3.Expand down to Computers | My Computer | DCOM Config 
    4.Right-click on hMailServer and select properties 
    5.Select the Security tab 
    6.Under "Launch and Activation Permissions", select Customize and click on Edit 
    7.Under "Group or user names", click Add 
    8.For IIS6: add the built-in anonymous IIS user account 
    9.For Apache: add the Apache user account 
    10.Set the Local Launch and Local Activation permissions for this user to Allow 
    

    实际上,我甚至试图在DCOM配置中授予EveryOne权限。

    安装PHPWebAdmin是为了给用户一个更改电子邮件密码的地方。

    这里的环境:Windows Server 2008,Apache2.2,PHP.4.5。

    为什么会出现这个问题?如何处理?

    非常感谢!

    3 回复  |  直到 14 年前
        1
  •  6
  •   VolkerK    14 年前

    php 5.4.5构建自 windows.php.net 将com/dotnet模块作为扩展dll提供。如果您的php版本也是这样,您可以通过

    extension=php_com_dotnet.dll
    

    在php.ini中

        2
  •  0
  •   rgettman    13 年前

    如果您使用的是windows8和apache服务器 extension=php_com_dotnet.dll 当时没有为您工作:

    复制 php_com_dotnet.dll file 到 c:/windows/system32 并写信给 php.ini 文件:

    extension = c:/windows/system32/php_com_dotnet.dll
    

    我使用的是windows8和用于windows的apache服务器。 为我工作。

    我希望这对你有所帮助:)

        3
  •  0
  •   Cyril Bargeton    8 年前

    为了解决这个问题,我注意到,在IIS 10/Windows Server 2016下,我无法使用32位版本的PHP 7.2(FastCGI)使该接口工作。

    解决方案对我来说非常明显:使用64位版本的PHP 7.2运行它(在我的案例中,为子目录“PHPWebadmin”创建一个新的应用程序,并更改处理程序映射,因为由于开发了一些特殊的32位扩展,主应用程序需要使用32位版本的PHP运行)。

    希望它能有所帮助,

    当做

    推荐文章