Archive

Posts Tagged ‘Parent process’

Tutorial: Cross-platform background process forking without extensions in PHP

February 9, 2007 Leave a comment

There are plenty of ways to fork new processes in PHP. You can use shell functions like exec() or shell(), the pcntl_* function set in the Process Control extension or stream/filesystem functions such as popen(). In this article, we’re going to look at the latter of these, and learn:

  • How to make it work on both Windows and Linux
  • How to make the forked process run in the background
  • How to communicate with the forked process
  • How to fork more than one process
  • How to cleanly terminate the forked process from the parent script Read more…
Advertisement
%d bloggers like this: