先到PHP.INI中打开COM选项,com.allow_dcom = true 注意: PHP 5.4.5后,com/dotnet 模块已经成了单独的扩展,所以需要在PHP.ini中配置extension=php_com_dotnet.dll ,如果PHP VERSION<5.4.5 则不需要。