How to kill the process that proc_open spawns

I have a PHP script where I create a new process using proc_open (). It takes about 2 hours, at the end I have proc_close ().

Sometimes I need to stop this process in the middle, how can I kill / notify it to stop and free resources in PHP

+3
source share
2 answers

First, you could create a script guide that calls proc_close (the $ process resource), this would apparently start to respond from the process, or if you need to terminate it immediately, you can call proc_terminate ();

+3
source

You are calling proc_terminate().

+3
source

Source: https://habr.com/ru/post/1717050/


All Articles