Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从PHP访问COM类_Php_Com - Fatal编程技术网

从PHP访问COM类

从PHP访问COM类,php,com,Php,Com,我在访问PHP中的COM类时遇到问题。我正在使用IIS8Express、PHP for Windows和WebMatrix(设置网站)。我可以让COM类在.NETVB脚本中工作,但不能在PHP5中工作。在经典ASP中也失败了。我已尝试以不同的组合使用dcomcnfg.exe进行设置。还尝试使用PHP.exe直接运行PHP文件,并获得相同的结果 这是我的密码: <?php error_reporting(E_ALL); ini_set("display_errors",1);

我在访问PHP中的COM类时遇到问题。我正在使用IIS8Express、PHP for Windows和WebMatrix(设置网站)。我可以让COM类在.NETVB脚本中工作,但不能在PHP5中工作。在经典ASP中也失败了。我已尝试以不同的组合使用
dcomcnfg.exe
进行设置。还尝试使用
PHP.exe
直接运行PHP文件,并获得相同的结果

这是我的密码:

<?php
    error_reporting(E_ALL);
    ini_set("display_errors",1);
    try
    {
        $tcsuser = new COM("TCSApi.TCSUser.1") or die("Can not connect to COM Class");
    }
    catch(com_exception $e)
    {
        echo $e->getMessage();
    }
?>

结果是:

无法创建COM对象“TCSApi.TCSUser.1”:不支持接口