PHP - 运行 exec 多个 php 文件 [英] PHP - Running exec multiple php files
问题描述
我正在运行一个执行数据挖掘的 curl 脚本;它运行所有日期大约需要 600 秒.所以我想,如果我用两个或三个或其他线程来分割负载,那么我可以分割 600 秒.
I'm running a curl script that does data mining; for it to run through all date it takes approx 600 seconds. So I figured, If I split the load with two or three or etc... threads, I could then split that 600 seconds.
有什么建议吗?
我知道一种方法是通过 Windows 调度程序,我可以让它执行多个文件;但理想情况下,我希望 Windows 调度程序执行(即 php-cgi thefilename.php)一个文件,并让该文件执行多个其他文件.
I know one way to do this is via windows scheduler, I can have it execute multiple files; but ideally I'd like to have windows scheduler execute (i.e. php-cgi thefilename.php) one single file and have that one exec multiple others.
有什么建议吗?谢谢,
推荐答案
并不是真正回答你的问题,而是一个解决方案.您可以像这样创建一个批处理文件:
Not really answering your question but a solution nevertheless. You could create a batch file like this:
start php-cgi thefilename.php
start php-cgi thefilename.php
start php-cgi thefilename.php
这将创建三个独立的线程.
This will create three independent threads.
这篇关于PHP - 运行 exec 多个 php 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!