• <small id='8z2Cq'></small><noframes id='8z2Cq'>

  • <tfoot id='8z2Cq'></tfoot>
    <i id='8z2Cq'><tr id='8z2Cq'><dt id='8z2Cq'><q id='8z2Cq'><span id='8z2Cq'><b id='8z2Cq'><form id='8z2Cq'><ins id='8z2Cq'></ins><ul id='8z2Cq'></ul><sub id='8z2Cq'></sub></form><legend id='8z2Cq'></legend><bdo id='8z2Cq'><pre id='8z2Cq'><center id='8z2Cq'></center></pre></bdo></b><th id='8z2Cq'></th></span></q></dt></tr></i><div id='8z2Cq'><tfoot id='8z2Cq'></tfoot><dl id='8z2Cq'><fieldset id='8z2Cq'></fieldset></dl></div>
    <legend id='8z2Cq'><style id='8z2Cq'><dir id='8z2Cq'><q id='8z2Cq'></q></dir></style></legend>
    • <bdo id='8z2Cq'></bdo><ul id='8z2Cq'></ul>
      1. php 后台 exec() 函数

        php in background exec() function(php 后台 exec() 函数)

        1. <legend id='nWlhz'><style id='nWlhz'><dir id='nWlhz'><q id='nWlhz'></q></dir></style></legend>
            <tbody id='nWlhz'></tbody>

          <small id='nWlhz'></small><noframes id='nWlhz'>

          • <bdo id='nWlhz'></bdo><ul id='nWlhz'></ul>
            <tfoot id='nWlhz'></tfoot>

                  <i id='nWlhz'><tr id='nWlhz'><dt id='nWlhz'><q id='nWlhz'><span id='nWlhz'><b id='nWlhz'><form id='nWlhz'><ins id='nWlhz'></ins><ul id='nWlhz'></ul><sub id='nWlhz'></sub></form><legend id='nWlhz'></legend><bdo id='nWlhz'><pre id='nWlhz'><center id='nWlhz'></center></pre></bdo></b><th id='nWlhz'></th></span></q></dt></tr></i><div id='nWlhz'><tfoot id='nWlhz'></tfoot><dl id='nWlhz'><fieldset id='nWlhz'></fieldset></dl></div>
                  本文介绍了php 后台 exec() 函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我制作这个脚本是为了测试 PHP 作为后台进程的执行

                  I made this script to test the execution of PHP as a background process

                  foreach($tests as $test) { 
                     exec("php test.php ".$test["id"]); 
                  } 
                  

                  如php进程背景中的建议和 如何添加使用 PHP 通过 Google Calendar API 的大量事件通知提醒? 和 php 执行后台过程

                  但是脚本的运行速度并不比没有添加 test.php 的所有脚本都快.

                  But the script does not run faster than when it was all in one script without the addition of test.php.

                  我做错了什么?

                  提前致谢!

                  推荐答案

                  exec() 将阻塞,直到您正在执行的进程完成 - 换句话说,您基本上是在运行您的'test.php' 作为子程序.您至少需要在命令行参数中添加一个 &,这会将 exec() 进程置于后台:

                  exec() will block until the process you're exec'ing has completed - in otherwords, you're basically running your 'test.php' as a subroutine. At bare minimum you need to add a & to the command line arguments, which would put that exec()'d process into the background:

                  exec("php test.php {$test['id']} &");
                  

                  这篇关于php 后台 exec() 函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is PHP or PHP based web framework stateful or stateless?(PHP 或基于 PHP 的 Web 框架是有状态的还是无状态的?)
                  How to parse django style template tags(如何解析 django 样式模板标签)
                  What is a good setup for editing PHP in Emacs?(在 Emacs 中编辑 PHP 的好设置是什么?)
                  How to check whether specified PID is currently running without invoking ps from PHP?(如何在不从 PHP 调用 ps 的情况下检查指定的 PID 当前是否正在运行?)
                  What#39;s the difference between escapeshellarg and escapeshellcmd?(escapeshellarg 和escapeshellcmd 有什么区别?)
                  How to avoid dynamic properties in PHP (raise an Error when setting an undeclared property)(如何避免 PHP 中的动态属性(设置未声明的属性时引发错误))
                  <tfoot id='dtO4A'></tfoot>
                    • <bdo id='dtO4A'></bdo><ul id='dtO4A'></ul>

                        <i id='dtO4A'><tr id='dtO4A'><dt id='dtO4A'><q id='dtO4A'><span id='dtO4A'><b id='dtO4A'><form id='dtO4A'><ins id='dtO4A'></ins><ul id='dtO4A'></ul><sub id='dtO4A'></sub></form><legend id='dtO4A'></legend><bdo id='dtO4A'><pre id='dtO4A'><center id='dtO4A'></center></pre></bdo></b><th id='dtO4A'></th></span></q></dt></tr></i><div id='dtO4A'><tfoot id='dtO4A'></tfoot><dl id='dtO4A'><fieldset id='dtO4A'></fieldset></dl></div>
                          <tbody id='dtO4A'></tbody>

                      1. <legend id='dtO4A'><style id='dtO4A'><dir id='dtO4A'><q id='dtO4A'></q></dir></style></legend>

                        <small id='dtO4A'></small><noframes id='dtO4A'>