致命错误:在 中找不到类“COM”.PHP5.3, Apache2.2, Windows Server 2008.


Fatal error: Class 'COM' not found in... PHP5.3, Apache2.2, Windows server 2008

另一个让我发疯的问题。这似乎是一个常见的错误,我无法使用"传统"方法(其他人为同一问题提供的答案)修复。

视窗 2008 R2 - x64

阿帕奇 2.2.25

PHP 5.3.27

我的php中有这些行.ini:

extension_dir = "C:'Program Files (x86)'PHP'ext'"
[COM_DOT_NET]
extension=php_com_dotnet.dll

php_com_dotnet.dll存在于该目录中,我什至更进一步,尝试为 PHP 文件夹的每个人分配读取权限,尽管它应该可以访问,因为它确实在那里加载了其他库。

下面是来自phpinfo()的配置命令,它实际上是唯一提到COM的内容。

cscript/nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:''php-sdk''oracle''instantclient10''sdk,shared" "--with-oci8=C:''php-sdk''oracle''instantclient10''sdk,shared" "--with-oci8-11g=C:''php-sdk''oracle''instantclient11''sdk,shared" "--启用对象输出目录=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analysis"

任何建议将不胜感激!谢谢

编辑

get_cfg_var('cfg_file_path') = C:'Program Files (x86)'PHP'php.ini

这是php.ini我已经编辑过了。

另外,这是错误日志,没有任何指向问题的内容。

[Mon Mar 31 14:51:09 2014] [notice] Apache/2.2.25 (Win32) PHP/5.3.27 mod_aspdotnet/2.2 configured -- resuming normal operations
[Mon Mar 31 14:51:09 2014] [notice] Server built: Jul 10 2013 01:52:12
[Mon Mar 31 14:51:09 2014] [notice] Parent: Created child process 3708
[Mon Mar 31 14:51:09 2014] [notice] mod_aspdotnet: CorBindToRuntimeEx has loaded version v2.0.50727 of the .NET CLR engine.
[Mon Mar 31 14:51:40 2014] [notice] Child 3708: Child process is running
[Mon Mar 31 14:51:40 2014] [notice] Child 3708: Acquired the start mutex.
[Mon Mar 31 14:51:40 2014] [notice] Child 3708: Starting 250 worker threads.
[Mon Mar 31 14:51:40 2014] [notice] Child 3708: Starting thread to listen on port 8086.
[Mon Mar 31 14:51:40 2014] [notice] Child 3708: Starting thread to listen on port 8084.

不是答案 - 只是试图获得更多数据
的输出是什么

<?php
$config = file(get_cfg_var('cfg_file_path'));
foreach( $config as $n=>$l) {
    if ( false!==strpos($l, 'dotnet') ) {
        printf("%03d %s<br />'r'n", $n, $l);
    }
}
echo 'com_dotnet: ', extension_loaded('com_dotnet') ? 'yes':'no', "<br />'r'n";
echo 'class: ', class_exists('COM')  ? 'yes':'no', "<br />'r'n";

更新:(来自评论的回答)

答案似乎是一个损坏或以某种方式"坏"的php_com_dotnet.dll,Windows安装程序没有替换它。我只是抓住了匹配的版本二进制zip,手动覆盖了dll-瞧!将您的答案标记为答案,因为它是最接近的,让我走上了正确的轨道。