WAMP and pcntl_fork

后端 未结 3 1355
情歌与酒
情歌与酒 2020-12-31 22:03

Is there a way to make pcntl_fork work in WAMP? I need to develop a forking solution and test it locally.

3条回答
  •  春和景丽
    2020-12-31 22:08

    No, it's not possible. The PCNTL extension requires *nix platforms.

    Now, with that said, what are you trying to do, and can you solve it without forking...?

    Edit: Some alternatives to launching background processes:

    • Unix/Linux:

      exec('nohup php yourscript.php > /dev/null 2>&1 &');
      
    • Windows;

      $com = new Com('WScript.shell');
      $com->run('php yourscript.php', 10, false);
      

      For documentation on the arguments, see: http://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.85).aspx

提交回复
热议问题