Uncaught exception 'com_exception' with message

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Uncaught exception 'com_exception' with message

Post by anjanesh »

Server : Windows 2003 IIS6.0 with PHP 5.0.3 support.
This is working on my PC but on the server it gives an error msg.

Code: Select all

<?php
// ini_set("com.allow_dcom","true");
$word = new COM("word.application") or die("Unable to instanciate Word");
echo "Loaded Word, version &#123;$word->Version&#125;\n";
?>
Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `word.application': Invalid syntax ' in xxx\test.php:3 Stack trace: #0 xxx\test.php(3): com->com('word.applicatio...') #1 {main} thrown in xxx\test.php on line 3

Any idea on how to resolve this ?
Thanks
Last edited by anjanesh on Mon Mar 07, 2005 12:35 pm, edited 1 time in total.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

BTW, is it possible that this error is being generated because of MS Office (MS Word in this case) not being installed.
Wanted to know if it requires MS Word to be installed or just some dll ?
Just for reference : Windows 2003 hosting details : http://webstrikesolutions.com/windows.html
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

You would need Word installed to do COM automation.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Why would it not require Word being installed? Word's install creates the com component links..
Post Reply