Fatal error:class ' COM ' not found in xxxxxxxxx
No COM class found
Cause analysis
Check to see if Php_com_dotnet.dll exists under the PHP Directory ext folder
Workaround:
★extension_dir ext Path is correct
★ENABLE_DL = On
★php the root directory of the Ext folder to ensure the existence of Php_com_dotnet.dll this file
★php.ini Make sure that you have this statement
[Php_com_dotnet]
Extension=php_com_dotnet.dll//is added one line, not open
Com.allow_dcom = True
★ Start > Run > Services.msc carriage return > Ensure that COM + Event System services are turned on
Before PHP version 5.4.5 was built, but later versions were separated
Then restart IIS or Apache, it's normal to run again!
after the configuration is complete, you can test with the following code:
Word = new COM ("Word.Application") or Die ("Unable to instanciate word");
Print "Loaded Word, Version {word->version}\n";
The above statement this machine must have Office installed to do so.
The OpenOffice are as follows:
$obj = new COM ("Com.sun.star.ServiceManager") or Die ("Unable to instanciate Word");
Here is a small example: (Note the path to open)
Word=newcom ("Word.Application") Ordie ("Unabletoinstanciateword");p rint "loadedword,version$word−>version\n"; /place its front word->visible = 0;
Open a document
Word−>documents−>open ("D:\wamp\www\test\1.doc"); do something. Echo word->activedocument->content->text ;
Close Word
$word->quit ();