日期:2014-05-16  浏览次数:20592 次

php调用 system函数用法 不能使用at执行任务?
代码如下:<?php

              system("at 13:40
                     /test/ffmpeg -y -i /test/h.264文件/ohyeah.264 -vcodec copy -acodec copy -f flv /test/hello.flv;",$a);
              system("whoami",$b);
              echo "$a";
              echo "$b";
?>
结果没有报错,但是at的任务显示为空,不能将我需要执行的的命令  /test/ffmpeg -y -i /test/h.264文件/ohyeah.264 -vcodec copy -acodec copy -f flv /test/hello.flv;",$a);放入at任务中。
------解决方案--------------------
at用法错了,它是读标准输入的:

echo '/test/ffmpeg -y -i /test/h.264文件/ohyeah.264 -vcodec copy -acodec copy -f flv /test/hello.flv' 
------解决方案--------------------
 at 13:40