PHP同时运行相同的脚本

时间:2015-09-28 11:30:51

标签: php shell

所以我试图在shell中运行具有不同参数的相同脚本。

for ($x = 0; $x < count($tests); $x++) {
    $plug = fopen('includes/test.txt', 'w');
    fputs($plug, $tests[$x]);
    fclose($plug);
    shell_exec("php test.sp > /dev/null &");
}

Test.sp从test.txt获取params并运行脚本。我想同时从10个不同的参数开始。 但它只是从$ tests的最后一个参数开始。

我可以问你们如何改变它吗?

0 个答案:

没有答案
相关问题