Since COM components can only be used on Windows, the program must be run on a Windows server. There was no problem in setting up and installing on the local
After installing the latest 12012 version of Wps office personal version, it is supposed to be completed, but the error reported on the server when running the program is as follows:
Fatal error: Uncaught exception 'com_exception' with message ' Failed to create COM object `WPS.Application': Access denied. ' in D:www9enjoy.comhx.php:12 Stack trace: #0 D:www9enjoy.comhx.php(12): com->com('WPS.Application') #1 {main} thrown in D:www9enjoy. comhx.php on line 12
If you run this sentence, $wps = new COM("WPS.Application"); will report an error. After some searching, I made some configurations in the DCOM configuration and solved this prompt.
1. Open the Control Panel - Administrative Tools - Component Services
2. Open the console root directory in the Component Services panel - Component Services - Computer - My Computer - DCOM Configuration
3. Find Kingsoft Writer Application Class (Kingsoft’s document application service), open the properties window, and switch to the security tab. Select Customize for "Startup and Activation Permissions", edit, and add everyone permissions. The same goes for "Access Permissions".
This error message passed, and another error occurred when running $doc = $wps->Documents->Open($src_filename);
Fatal error: Uncaught exception 'com_exception' with message 'Error [0x800706be] Remote procedure call failed. ' in D:www9enjoy.comhx.php:15 Stack trace: #0 D:www9enjoy.comhx.php(15): variant->Open('d:www9enjoy.com...') #1 {main} thrown in D:www9enjoy.comhx.php on line 15
In the "Identification" tab, change the startup user to an interactive user, and another error message appears:
Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `WPS.Application': The system cannot start the server process because the configuration type is incorrect. Please check username and password. ' in D:www9enjoy.comhx.php:15 Stack trace: #0 D:www9enjoy.comhx.php(15): com->com('WPS.Application') #1 {main} thrown in D:www9enjoy. comhx.php on line 15
Tried repeatedly, but nothing worked, including reinstalling WPS.
After the "identification" tag, run it with the specified user. Run it with the user used by the website first. If it fails, it will not pass. If you run it again using the administrator account, an error message will pop up when you click OK. It should be that neither of these two options (starting user and specifying user) can start this com component. If you use an interactive user, it is ok, but it prompts that the username and password are incorrect: (
In the post-test, sometimes it ran for a long time and no error was reported... The following error also occurred:
Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `WPS.Application': Server operation failed' in D:www9enjoy.comhx.php:30 Stack trace: #0 D:www9enjoy.comhx.php(30) : com->com('WPS.Application') #1 {main} thrown in D:www9enjoy.comhx.php on line 30 During
it was also found that due to the execution to $wps->Documents- >Open will stop, and a wps or wpsupdate process will appear in the process, one will appear every time it is refreshed. At most, more than 30 such processes will be found at one time, and sometimes it will affect the program and need to be deleted manually one by one.
Finally, I used a very BT approach to run the IIS authentication method of this site using the administrator account, and it worked!