Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WAMP and pcntl_fork

Tags:

php

wamp

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

like image 729
StackOverflowNewbie Avatar asked Feb 02 '11 19:02

StackOverflowNewbie


1 Answers

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

like image 90
ircmaxell Avatar answered Oct 17 '22 00:10

ircmaxell