PHP exec()日志输出

一、

$commandString = 'you_command_here >> log_file.log 2>&1 &';
$command = exec($commandString);



二、

$cmd = '/usr/local/bin/ffmpeg -i http://m.bcb.cn:8134/vod/3min/2015/201504211621.mp4 -ss 00:00:10 -vframes 1 -f image2 image1.jpg >> log_file.log 2>&1 &';

$res = exec($cmd." 2>&1", $out, $ret);
if ($ret){
    echo "There was a problem!\n";
    print_r($out);
}else{
    echo "Everything went better than expected!\n";
}



你可能感兴趣的:(PHP exec()日志输出)