php exec():ant不会运行也不会输出

php exec():ant不会运行也不会输出,php,ant,Php,Ant,我一直在尝试使用“system”和“exec”函数从PHP运行Ant脚本 我的ant脚本工作正常,我可以从命令行调用它,一切正常。但是,当从php调用它时,它不起作用,我无法获得用于调试的输出 这是我的电话: exec("ant -buildfile ".$scriptname." -DInputPath=\"../uploads/".$file."\" -DOutputDir=\"./output/".$newfile."\" convert" , $output,$return_value)

我一直在尝试使用“system”和“exec”函数从PHP运行Ant脚本

我的ant脚本工作正常,我可以从命令行调用它,一切正常。但是,当从php调用它时,它不起作用,我无法获得用于调试的输出

这是我的电话:

exec("ant -buildfile ".$scriptname." -DInputPath=\"../uploads/".$file."\" -DOutputDir=\"./output/".$newfile."\" convert" , $output,$return_value);
知道:

file_exists($scriptname); //returns true,
$output; //is empty
$return_value; //is set to 1.
我用于测试的ant脚本只有这样一个复制任务(在名为“convert”的目标中):

问候,,
Brice.

可能您的PHP进程没有足够的权限创建新的ant进程。所以我会检查权限,并在同一组中添加ant/php。尝试给出ant命令的完整路径。@Arfeen成功了!谢谢
copy file="${InputPath}" tofile="${OutputDir}"