Home >Backend Development >PHP Problem >How to understand PHP architecture layout
This article will introduce you to the PHP architecture layout. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Execution process
It can be seen from the above figure that there are mainly four stages from parsing PHPCode to execution.
To obtain token, you can obtain token information through the Token_get_all('<?php echo "str";>')
function.
Abstract syntax tree mainly decouples the interpreter and compiler.
The instructions that opcodes are ultimately executed, such as ZEND_ECHO: are essentially a corresponding C function.
The Zend layer provides some basic memory management and data structures for the upper PHP layer.
The SAPI layer communicates with the server for the upper layer, encapsulating different communication types. cgi, fast-cgi, cli, etc.
stores the upper-layer API interaction forms supported by different environments, and implements different input and output forms.
Stores PHP-related core code, memory management, etc. as mentioned above.
is responsible for the entrance to interact with the Zend layer, and Some hook functions.
Mainly expand related directories. Generate custom modules through the ext_skel
command. They will be installed in this directory by default.
Directories related to thread resource management, generally only when used in conjunction with Apache, will involve code related to thread resource management.
Those related to Nginx will generally only use the FastCGI protocol and not involve it. TSRM module.
Recommended learning: php video tutorial
The above is the detailed content of How to understand PHP architecture layout. For more information, please follow other related articles on the PHP Chinese website!