This is the 21st day of my participation in Gwen Challenge.

Star: github.com/Jackson0714… Personal website: www.passjava.cn

Two nodes in the PHP life cycle

Once PHP starts executing, it goes through two main phases:

The start phase before processing the request and the end phase after the request.

  • The beginning:

    • Module initialization phase (MINT), only once.
    • In the module activation phase (RINIT),PHP calls RINIT functions for all modules
  • End phase (PHP enters the end phase at the end of script execution or by calling exit() or die()).)

    • Disable module (RSHUTDOWN, corresponding to RINIT)

    • Shut down the module (MSHUTDOWN, corresponding to MINIT), exit the Web server, or exit the command line script after execution

Work done during the life cycle

(1)

(2) Initialize several global variables

(3) Initialize several constants

(4) Initialize Zend engine and summation components

(5) the parse PHP ini

(6) Initialization of global operation functions

(7) Initialize statically built modules and shared modules (MINIT)

(8) Disable functions and classes

(9) ACTIVATION

(10) Activate Zend engine

Activate SAPI (11)

(12) Environment initialization

(13) The module requests initialization

(14)

The php_execute_script function contains the entire process of running a PHP script

(15) DEACTIVATION

(16) flush

Sapi_flush flushes out the last contents

(17) Stop the Zend engine

What is the Zend engine?

The Zend engine is the heart of the PHP implementation and provides the infrastructure on which the language is implemented.

PHP syntax time limit, script compile and run environment, extension mechanism and memory management.

Many PHP extensions use the Zend API, which is an implementation of the PHP language itself. PHP only uses the Zend kernel to build the PHP language.

Welcome to follow my official account: “Wukong Chat Framework”

About the author: 8-year Veteran of Internet workplace | full stack engineer | super dad after 90 | open source practitioner | owner of public number 10,000 fans original number. Blue Bridge signed the author, the author of “JVM performance tuning practice” column, handwritten a set of 70,000 words SpringCloud practice summary and 30,000 words distributed algorithm summary. Welcome to follow my public account “Wukong Chat framework”, free access to learning materials.

I am Wukong, strive to become stronger, become super Saiya people!