从CLI执行多个同时的php脚本 [英] Executing multiple simultaneous php scripts from CLI
问题描述
我有55个php文件,我想从命令行同时运行。现在,我正在使用以下代码在多个CLI窗口中运行它们:
I have 55 php files that I would like to run simultaneously from the command line. Right now, I am running them in multiple CLI windows using the code:
php Script1.php
我希望能够调用一个可以同时执行所有55个php文件的单个php文件。我一直在阅读有关如何使命令行不等待输出的信息,但似乎无法使其正常工作。
I would like to be able to call one single php file that would execute all 55 php files simultaneously. I have been reading about how to make the command line not wait for the output, but I can't seem to make it work.
此线程:
如何从CLI运行多个PHP脚本
建议放置&在命令末尾在后台运行该命令,但是使用xampp CLI似乎没有任何作用。
suggests putting an & at the end of the command to run the command in the background, but using the xampp CLI this doesn't seem to do anything.
任何想法都值得赞赏。
Brian
推荐答案
通过提及XAMPP,我假设您在Windows上。我认为您需要的是 start
命令。您可能需要启动php Script1.php
。有关更多信息,请执行
By mentioning XAMPP, I assume you are on windows. I think what you need is the start
command. You probably need start php Script1.php
. For more info, do a
start /?|more
这篇关于从CLI执行多个同时的php脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!