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?
🏷️ Limited Offer: 25% OFF 🏷️
First 100 purchases only — Special discount!
Use this coupon on checkout: PHPDXPJ_D1SC1N5T
Get it nowWhile 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_valueAnd 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.