Use pcntl_fork to create a sub-process in php-fpm connection mode. The simplest code is: {code ...} 6 '-' is output in cli mode, but only 2 '-' is output in php-fpm connection mode '-', that is, only the results of the main process or a sub-process can be output during the php-fpm connection. How can I use pcntl_fork to create a sub-process in php-f... php-fpm connection mode? The simplest code is as follows:
6 '-' is output in cli mode, but only 2 '-' is output in php-fpm connection mode '-', that is, only the results of the main process or a sub-process can be output during the php-fpm connection. How can I get all the output in php-fpm or where is the output in php-fpm? Has anyone ever encountered this problem?
Reply content:In php-fpm connection mode, use pcntl_fork to create a sub-process. The simplest code is as follows:
6 '-' is output in cli mode, but only 2 '-' is output in php-fpm connection mode '-', that is, only the results of the main process or a sub-process can be output during the php-fpm connection. How can I get all the output in php-fpm or where is the output in php-fpm? Has anyone ever encountered this problem?
Never met. In ubuntu, php-fpm installed with apt-get is disabled by default for the pcntl module, and all these functions are written into disabled_functions.
Php-fpm has a management process on its own and should not have used this function. Otherwise, the behavior will be uncertain. For example, the management process may kill too many processes.
Pcntl_fork is only available under cli, and php-fpm is not supported. To do so, you can downgrade the system method or popen method in php-fpm to execute a cli program.