开发者

PHP new DOTNET() error

开发者 https://www.devze.com 2023-01-08 19:45 出处:网络
This is a fairly obscure question, but I\'m having a devil of a time figuring it out: I\'m running PHP on IIS and am using PHP\'s DOTNET function to load Microsoft\'s System.Speech class.

This is a fairly obscure question, but I'm having a devil of a time figuring it out:

I'm running PHP on IIS and am using PHP's DOTNET function to load Microsoft's System.Speech class.

<?php

$recognizer= new DOTNET('System.Speech, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35', 'System.Speech');

?>

I'm getting a 500 error when I load the above file into my browser.

The error message says:

Fatal error: Uncaught exception 'com_exception' with mess开发者_JAVA技巧age 'Failed to create COM object `SAPI.SpSharedRecognizer': Access is denied. '

Ideas?


Sounds like, the web server account (IIS application pool identity) does not have access permissions to the resource file you are trying to open in your code.

Also, there is a problem in your code - the DOTNET function requires two arguments - an assembly name and a class name. You are providing "System.Speech" as the second parameter - this is only a namespace, not the class.

0

精彩评论

暂无评论...
验证码 换一张
取 消