A treasure map for exploring the maze of PHP cores

Source: Internet
Author: User
Tags zend

PHP kernel is like a maze, if there is not a picture of the overall picture, just face one of the points, it will be like a maze, walk to walk to the dead end. Wandering around in this maze for a long time, recently got a PHP treasure map, and then look at this map to visit the PHP kernel, suddenly feel that the landscape of a lot of clear. Nonsense not to say,:

This diagram includes two parts, corresponding to the PHP startup process, and the process for PHP to process each request. The PHP startup process is a series of initialization operations that establish the various global variables that are used when processing requests:

Apache Boot

= Sapi_startup

= = Php_module_startup (main switch of PHP)

= Php_output_startup

= = Zend_startup (start Zend Engine)

= Register_ini_entries

= Php_ini_stream_wrappers

= = Php_ini_register_extensions (start dynamically loaded extensions)

= Zend_startup_modules

= Zend_startup_extensions


Here is the process for handling each request:

Php_handler

= Php_apche_request_ctor

= Zend_activate

= Zend_execute_scripts

= = Zend_compile (Syntax analysis, semantic analysis, generative Oparray)

= zend_execute (Executive opcode)

= Zend_deactivate


Turn off Zend, PHP when the process exits:

Sapi_shutdown

= Zend_shutdown

A treasure map for exploring the maze of PHP cores

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.