While using TransformDocAdvMSWord for conversion, due to the large size of my template file, some processes take a long time to execute. Is there a way to terminate these processes?
While using TransformDocAdvMSWord for conversion, due to the large size of my template file, some processes take a long time to execute. Is there a way to terminate these processes?
Hello,
If the process doesn't end automatically after the PHP time limit set in the PHP configuration (or you are using an unlimited time), you can handle Windows processes using tasklist and taskkill commands with the shell_exec PHP function. For example, get the running MS Word processes:
tasklist /svc /fi "imagename eq WINWORD.exe"
or:
tasklist /svc | findstr "WINWORD"
Kill MS Word processes:
taskkill /F /IM "WINWORD.exe"
Kill a process by its PID (replace pid_value by the PID):
taskkill /PID pid_value
And the same if you want to kill php processes. For example, to kill all php.exe processes:
taskkill /F /IM "php.exe"
getmypid available in PHP returns the PHP process ID to kill a specific php PID.
Regards.