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 message ‘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.