SAPI
SAPI (Server application Programming INTERFAC) is a application programming interface (API) provided by the Web Server to Help other developers in extending the Web server capabilities.
SAPI is an application interface (API) that is used to help other developers extend the functionality of the Web server. It abstracts the external conditions and provides a set of fixed and unified interfaces for internal PHP, so that PHP can not be affected by the external environment and maintain its independence.
The common SAPI in PHP are CLI (command line mode, single process), PHP-FPM, CGI, Apache ...
It's a bit like policy mode, using the same interface, but the implementation is slightly different.
PHP Start-up and termination
The life cycle of PHP
1. Single-Process SAPI life cycle (cli/cgi)
2. Multi-process SAPI life cycle (APACHE2)
3. Multi-threaded SAPI life cycle
4.Embed
Embed SAPI is a special SAPI that allows you to invoke the functions provided by php/ze in the C + + language. (not quite understand, look at it tomorrow!) http://www.laruence.com/2008/09/23/539.html)
Review
Check the lifecycle of PHP and the entire process of PHP execution. And how to communicate through SAPI and PHP modules.
(The picture is basically from the reference link over there, standing on the shoulders of predecessors.) )