Copy the code The code is as follows:
$command = '/usr/bin/php /pub/www/u111/job/Crondo/ auto_collector.php &';
$process = proc_open($command, array(),$pipes);
$var = proc_get_status($process);
proc_close($process);
//pid is the process ID. As for why it needs to be added by 1, I still don’t understand it. After many tests, I found that the ID obtained by $var['pid'] is 1 less than the actual one
$pid = intval($var['pid'])+1;
//Kill the process
proc_close(proc_open('kill -9 '.$pid, array(), $pipes));
http://www.bkjia.com/PHPjc/324223.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/324223.htmlTechArticleCopy the code as follows: $command = '/usr/bin/php /pub/www/u111/job/ Crondo/auto_collector.php $process = proc_open($command, array(),$pipes); $var = proc_get_status($process); pr...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn