Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to kill a process which is spawned by proc_open

Tags:

php

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

Sometimes I need to stop this process in the middle , how do I kill/signal it to stop and free up the resources in PHP

like image 757
Vidya Avatar asked Feb 15 '26 19:02

Vidya


1 Answers

well firstly you could create a manual script that calls proc_close ( resource $process ) this would initally wait obviously for a response from the process or if you need to immediately terminate it you can call proc_terminate();

like image 128
Llanilek Avatar answered Feb 17 '26 08:02

Llanilek