SAPI life cycle of multiple processes
PHP is usually compiled as a module of Apache to handle PHP requests. Apache will generally use multi-process mode, Apache will fork out many sub-processes, each process of memory space Independent, each sub-process will go through the start and end links, but the beginning of each process only after the process fork out, Multiple requests may be processed throughout the lifetime of the process. The shutdown phase occurs only when Apache is closed or the process is ended, and between these two phases begins with each request repeating the request-the link of the request shutdown.
Multi-process SAPI life cycle
Multi-threaded SAPI life cycle
The multithreading pattern is similar to a process in a multi-process, and the difference is that the request initiation-request closure is repeated in parallel throughout the life cycle of the process.
Multithreading SAPI life cycle
5.PHP kernel exploration: SAPI lifecycle of multiple processes/threads