: This article describes how to call the COM component in php. For more information about PHP tutorials, see. Enable COM component in PHP
1. first open the COM option in PHP. INI, com. allow_dcom = true
2. my environment here is PHP5.4.7. after PHP 5.4.5, the com/dotnet module has become a separate extension. configure extension = php_com_dotnet.dll in ini. this parameter is not required if php version <5.4.5. Otherwise, Fatal error: Class 'com' not found may be reported.
Configuration Method: Add extension = php_com_dotnet.dll to the extension list.
After the configuration is complete, you can test the statement as follows:
$ Word = new COM ("word. application") or die ("Unable to instancate Word ");
Print "Loaded Word, version {$ word-> Version} \ n ";
In the preceding statement, the local machine must have an office installed.
Openoffice:
$ Obj = new COM ("com. sun. star. ServiceManager") or die ("Unable to instancate Word ");
The above describes how to call the COM component in php, including related content, and hope to help those who are interested in the PHP Tutorial.