PHP kernel Two major processes to start PHP core code snippet

Source: Internet
Author: User
Tags register php wrappers zend

Step 1:start the sapiextern zend_module_entry php_apache_module;static int php_apache2_startup (SAPI_MODULE_STRUCT * Sapi_module) {if (Php_module_startup (Sapi_module, &php_apache_module, 1) ==failure) {return FAIL        URE; } return SUCCESS;} Step 2:start the Phpint php_module_startup (sapi_module_struct *sf, Zend_module_entry *additional_modules, uint num_        Additional_modules) {zend_utility_functions zuf;        Zend_utility_values zuv;.....sapi_module = *sf;php_output_startup ();        Zuf.error_function = PHP_ERROR_CB;        Zuf.printf_function = php_printf;        Zuf.write_function = Php_output_wrapper;        Zuf.fopen_function = Php_fopen_wrapper_for_zend;        Zuf.message_handler = Php_message_handler_for_zend;        Zuf.block_interruptions = sapi_module.block_interruptions;        Zuf.unblock_interruptions = sapi_module.unblock_interruptions;        Zuf.get_configuration_directive = Php_get_configuration_directive_for_zend; zuf.tIcks_function = Php_run_ticks;        Zuf.on_timeout = Php_on_timeout;        Zuf.stream_open_function = Php_stream_open_for_zend;        Zuf.vspprintf_function = vspprintf;        Zuf.getenv_function = sapi_getenv;        Zuf.resolve_path_function = Php_resolve_path_for_zend;        Zend_startup (&zuf, NULL tsrmls_cc), ... gc_globals_ctor (tsrmls_c); * * Register PHP Core INI Entries */        Register_ini_entries ();        /* Register Zend INI Entries */zend_register_standard_ini_entries (Tsrmls_c);                /* Disable Realpath Cache If a open_basedir is set */if (PG (open_basedir) && *pg (Open_basedir)) {        CWDG (Realpath_cache_size_limit) = 0;        }/* Initialize stream Wrappers Registry * (this uses configuration parameters from php.ini) */ if (Php_init_stream_wrappers (module_number tsrmls_cc) = = FAILURE) {php_printf ("php:unable to I           Nitialize stream URL wrappers.\n ");     return FAILURE; }/* Startup extensions staticly compiled in */if (Php_register_internal_extensions_func (tsrmls_c) = = Failu                RE) {php_printf ("Unable to start builtin modules\n");        return FAILURE; }/* Start additional PHP extensions */PHP_REGISTER_EXTENSIONS_BC (additional_modules, Num_additional_module        s tsrmls_cc); /* Load and startup extensions compiled as shared objects (aka DLLs) as requested by php.ini entries T Heese is loaded after initialization of internal extensions as extensions *might* rely on things from Ext/stand ard which is always a internal extension and to being initialized ahead of all other internals *        /Php_ini_register_extensions (Tsrmls_c);        Zend_startup_modules (Tsrmls_c); /* Start Zend Extensions */zend_startup_extensions (); int Zend_startup (zend_utility_functions *utility_functions, Char **extenSions tsrmls_dc)/* {{{*/{zend_compiler_globals *compiler_globals;        Zend_executor_globals *executor_globals; zend_compile_file = Compile_file;        ZEND_EXECUTE_EX = EXECUTE_EX;        Zend_execute_internal = NULL; Zend_init_opcodes_handlers (); ...}

PHP kernel Two major processes to start PHP core code snippet

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: 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.