php调用外部脚本
我需要用php做一个web页面,通过表单传入2个参数,外加一个本地文件到服务器,
<form enctype="multipart/form-data" name="wcg_latency" action="wcg_latency_handle.php" method="post">
<input size="20" type="text" name="p1" value="1.1.1.1:8080" />
<input size="15" type="text" name="p2" value="2.2.2.2" />
<input type="file" name="file" />
<input type="submit" value="Go" id="su" />
点击submit提交表单,后台处理上传文件等,然后需要php调用一个外部的python脚本,
$command = $work_dir . "php_exec.py " . $file_dir . " " . $_FILES['files']['name'] . " " . $p1 . " " . $p2;
passthru($command, $result);
echo $result;
即调用在work_di目录下的php_exec.py脚本,(带有四个参数),感觉没问题,为什么浏览器一直在submit页面,不跳转,也没result值,在后台看了一下,脚本只执行了一段。绝大部分功能都没实现,这是什么原因,菜鸟求各位大神指点。(红色标记的php调用外部命令的函数pssthru换成system和exec结果一样)