pcntl-fork equivalent with php-fpm

125 views Asked by At

I have recently migrated one of my php applications from hostgator to AWS using the Apache AMI.

The PHP is running with the server API as FMP/FastCGI, my code is currently built for CGI/FastCGI.

With the change I lost my pcntl_fork() function.

I used the pcntl_fork to start a long running process from a browser interface and be able to continue to use the browser.

I have no experience working with FPM API or its differences to the CGI.

With that said my question is where is the documentation on working with the FPM (if I am thinking this right)

How would I accomplish this with my current setup?

Or I could be completely missing the mark altogether, any direction would be very appreciated.

basic premise of what used to work, now getting call to undefined function pcntl_fork

loop() {
 $pid = pcntl_fork()
 if($pid === 0) {
   do new process
 } else if($pid === -1) {
   process error
 } else {
  $pidAry[] = $pid
  continue loop
 }
}
0

There are 0 answers