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

        <small id='8NETj'></small><noframes id='8NETj'>

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

      2. <tfoot id='8NETj'></tfoot>
      3. Windows机器上的PHP;在后台启动进程

        时间:2023-10-30
          <tbody id='4HBmY'></tbody>

              <small id='4HBmY'></small><noframes id='4HBmY'>

                <bdo id='4HBmY'></bdo><ul id='4HBmY'></ul>
                <i id='4HBmY'><tr id='4HBmY'><dt id='4HBmY'><q id='4HBmY'><span id='4HBmY'><b id='4HBmY'><form id='4HBmY'><ins id='4HBmY'></ins><ul id='4HBmY'></ul><sub id='4HBmY'></sub></form><legend id='4HBmY'></legend><bdo id='4HBmY'><pre id='4HBmY'><center id='4HBmY'></center></pre></bdo></b><th id='4HBmY'></th></span></q></dt></tr></i><div id='4HBmY'><tfoot id='4HBmY'></tfoot><dl id='4HBmY'><fieldset id='4HBmY'></fieldset></dl></div>
              • <tfoot id='4HBmY'></tfoot><legend id='4HBmY'><style id='4HBmY'><dir id='4HBmY'><q id='4HBmY'></q></dir></style></legend>

                  本文介绍了Windows机器上的PHP;在后台启动进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在寻找最好的方法,或者任何真正在后台从 php 启动进程的方法,以便稍后在脚本中终止它.

                  I'm looking for the best, or any way really to start a process from php in the background so I can kill it later in the script.

                  现在,我正在使用:shell_exec($Command);这样做的问题是它等待程序关闭.

                  Right now, I'm using: shell_exec($Command); The problem with this is it waits for the program to close.

                  我想要在执行 shell 命令时与 nohup 具有相同效果的东西.这将允许我在后台运行该进程,以便稍后在脚本中将其关闭.我需要关闭它,因为这个脚本会定期运行,运行时程序无法打开.

                  I want something that will have the same effect as nohup when I execute the shell command. This will allow me to run the process in the background, so that later in the script it can be closed. I need to close it because this script will run on a regular basis and the program can't be open when this runs.

                  我曾想过生成一个 .bat 文件以在后台运行命令,但即便如此,我以后如何终止该进程?

                  I've thought of generating a .bat file to run the command in the background, but even then, how do I kill the process later?

                  我看到的linux代码是:

                  The code I've seen for linux is:

                  $PID = shell_exec("nohup $Command > /dev/null & echo $!");
                  // Later on to kill it
                  exec("kill -KILL $PID");
                  

                  编辑:事实证明我不需要终止进程

                  EDIT: Turns out I don't need to kill the process

                  推荐答案

                  请问这个PHP 手册中的函数 帮助?

                  function runAsynchronously($path,$arguments) {
                      $WshShell = new COM("WScript.Shell");
                      $oShellLink = $WshShell->CreateShortcut("temp.lnk");
                      $oShellLink->TargetPath = $path;
                      $oShellLink->Arguments = $arguments;
                      $oShellLink->WorkingDirectory = dirname($path);
                      $oShellLink->WindowStyle = 1;
                      $oShellLink->Save();
                      $oExec = $WshShell->Run("temp.lnk", 7, false);
                      unset($WshShell,$oShellLink,$oExec);
                      unlink("temp.lnk");
                  }
                  

                  这篇关于Windows机器上的PHP;在后台启动进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在后台使用 PHPMailer 发送电子邮件? 下一篇:PHP - 长时间运行的后台任务

                  相关文章

                  <tfoot id='VK7hO'></tfoot>
                  • <bdo id='VK7hO'></bdo><ul id='VK7hO'></ul>
                  <legend id='VK7hO'><style id='VK7hO'><dir id='VK7hO'><q id='VK7hO'></q></dir></style></legend>

                    1. <small id='VK7hO'></small><noframes id='VK7hO'>

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