Php com objects - "Failed to create COM object"

I need to use php’s COM object functionality to work with other applications. I’ll be working with an app created internally at work, but I figured I’d make sure I could get up and running with COM by trying to open word, excel, ie, etc (all of which are installed on my machine).

When i attempt to open any of these apps, I get this error:

PHP Fatal error: Uncaught exception 'com_exception'
with message 'Failed to create COM object
`InternetExplorer.Application': Access is denied. ' in
C:\\Inetpub\\wwwroot\\word.php:4 Stack trace: #0
com->com('InternetExplore...') #1 {main} thrown in
C:\\Inetpub\\wwwroot\\word.php on line 4

Here is sample code:

$ie = new COM("InternetExplorer.Application");
$ie->Visible = true;

I’m running Windows XP with iis5.1 and php5.2.1 (as cgi)
(phpinfo() output attached as pdf)

The php manual states

You are responsible for installing support for the various COM objects that you intend to use (such as MS Word); we don’t and can’t bundle all of those with PHP.

…which would seem to imply that i need to “install support for the various COM objects I intend to use”… but I’m not sure where to go for this.

So how can I get “support for the various COM objects”?
What com-related php.ini settings are required?
Are there permission issues that need to be addressed?


I managed to find this useful article:
which goes into some detail about php.ini settings and permissions. On page 5, it made me realize that I wasn’t setting permissions in the proper locations (I was setting local network permissions, but not my local machine). So I’ve set access permissions for Excel to “Everyone” local machine and local network… but I’m still getting the same error as before…

However, when I look in the Task Manager, I see that new instances of Excel are being opened when I run my script. I’m attempting to set Visible to true, but that’s not happening.

I didn’t see it in the php manual, but someone remarked on another forum that COM stuff can only be done in the command line (PHP CLI) – is that true?

—still stuck!:confused: