Edit report at https://bugs.php.net/bug.php?id=32133&edit=1
ID: 32133 Comment by: pankaj dot raturi2911 at gmail dot com Reported by: fLAre_Dra_X at yahoo dot com Summary: Failed create COM object Status: No Feedback Type: Bug Package: COM related Operating System: Windows XP SP 2 PHP Version: 5.0.1 Block user comment: N Private report: N New Comment: I am using windows 7 operating system, and i have the latest version of php as seen in xampp PHP/5.3.5. I tried to create a word document using COM but got the error below Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `word.application': Server execution failed ' in C:\xampp\htdocs\Snigdha_new1\Testing\testfile.php:33 Stack trace: #0 C:\xampp\htdocs\Snigdha_new1\Testing\testfile.php(33): com->com('word.applicatio...') #1 {main} thrown in C:\xampp\htdocs\Snigdha_new1\Testing\testfile.php on line 33 I used the as below // htmlviewer.php // convert a Word doc to an HTML file //$DocumentPath = str_replace("\\", "\\", $DocumentPath); $DocumentPath="../upload/gaurav_cv.rtf"; // create an instance of the Word application $word = new COM("word.application") or die("Unable to instantiate application object"); // creating an instance of the Word Document object $wordDocument = new COM("word.document") or die("Unable to instantiate document object"); $word->Visible = 0; // open up an empty document $wordDocument = $word->Documents->Open($DocumentPath); // create the filename for the HTML version $HTMLPath = substr_replace($DocumentPath, 'txt', -3, 3); // save the document as HTML $wordDocument=$word->Documents->SaveAs($HTMLPath, 3); // clean up $wordDocument = null; $word->Quit(); $word = null; // redirect the browser to the newly-created document header("Location:". $HTMLPath); header("Location:". $HTMLPath); ?> Can someone help Previous Comments: ------------------------------------------------------------------------ [2009-11-16 06:43:37] mic_sri at yahoo dot co dot in hi i have the same problem. that is COM object is not create. its run in my local server(WAMP). In the remote server it is not run it shows 'Fail to create DOM object' Please tell me any one where i made a mistake Regards Michael mic_...@yahoo.co.in ------------------------------------------------------------------------ [2008-04-25 22:52:50] webmaster at zeninmotion dot com I had the same issue, solved it using this guide: http://figured-it-out.com/figured-out.php?sid=24 ------------------------------------------------------------------------ [2007-11-06 12:32:05] taylor dot ren at gmail dot com Acknowledged that the above solution works fine in Vista. But there is a new error message when I tried: $doc=$word->Documents->Add(); it says: Word is unable to trigger event. I have Office 2003 installed. I guess it is due to the Add method is not the corrrect method name. Any hints? ------------------------------------------------------------------------ [2006-01-03 13:31:17] ozovadia at hotmail dot com Here is a possible solution: Verify that the user has the appropriate permissions to start the DCOM server. 1. In the Control Panel, double-click Administrative Tools, and then double-click Component Services. 2. In the Component Services snap-in, expand Computers, expand My Computer, and double-click DCOM Config. 3. In the right pane, locate the program you are trying to create. 4. Right-click the program name, and then select Properties. On the Security tab, in the Launch and Activation Permissions group box, select Customize, and then click Edit. 5. Add the user (e.g. running the IIS server) to the permissions list, and give the user the appropriate permissions. That should do it. ------------------------------------------------------------------------ [2006-01-03 12:06:55] ozovadia at hotmail dot com Installed the latest version (5.1.1.1) and still experiencing the same problem. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=32133 -- Edit this bug report at https://bugs.php.net/bug.php?id=32133&edit=1