php中exec函数执行bat脚本,为什么有时可以,有时失败??
bat脚本
@echo off
^
ffmpeg -f concat -i C:^AMP^apache2.4^htdocs^test^upload^2016-10-12^wu_1aurf2i6412121lrl4id1rqr1vgj0^filelist.txt -c copy C:^AMP^apache2.4^htdocs^test^upload^2016-10-12^57fdaea7c33d7.mpg
^
cd /
^
rd /S /Q C:^AMP^apache2.4^htdocs^test^upload^2016-10-12^wu_1aurf2i6412121lrl4id1rqr1vgj0
^
echo finished
^
php的执行代码:
$cmd ="C:AMPapache2.4htdocstestupload2016-10-12wu_1aurf2i6412121lrl4id1rqr1vgj0merg.bat";
//$cmd = "./../merg.bat";
$res = exec($cmd);
var_dump($res);
php中exec函数执行bat脚本,为什么有时可以,有时失败??
bat脚本
@echo off
^
ffmpeg -f concat -i C:^AMP^apache2.4^htdocs^test^upload^2016-10-12^wu_1aurf2i6412121lrl4id1rqr1vgj0^filelist.txt -c copy C:^AMP^apache2.4^htdocs^test^upload^2016-10-12^57fdaea7c33d7.mpg
^
cd /
^
rd /S /Q C:^AMP^apache2.4^htdocs^test^upload^2016-10-12^wu_1aurf2i6412121lrl4id1rqr1vgj0
^
echo finished
^
php的执行代码:
$cmd ="C:AMPapache2.4htdocstestupload2016-10-12wu_1aurf2i6412121lrl4id1rqr1vgj0merg.bat";
//$cmd = "./../merg.bat";
$res = exec($cmd);
var_dump($res);
查看ffmpeg的日志,来定位
可以用status来判断,重复执行,保证结果。
谢邀。是否是并发执行bat
文件有同时操作同一个文件,造成报错。楼上说的也是查错方法。