In local linux box with PHP i need to execute some task such as process start and after a while use the processID to kill.
Where Perl, IPC::Open3 was satisfaction way to achieve this, how can i do this this same with PHP? Has anyone done this before in PHP?
in PERL:
use IPC::Open3;
my @cmd = ('wget','-O','-','http://10.10.1.72/index.php');#any webs开发者_开发技巧ite will do here
my ($wget_pid,$wget_in,$wget_out,$wget_err);
if (!($wget_pid = open3($wget_in,$wget_out,$wget_err,@cmd))){
print STDERR "failed to run open3\n";
exit(1)
}
close($wget_in);
Thanks
Use proc_open() and make sure you have pcntl enabled
精彩评论