<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # PHP運行主要步驟 ![php內核代碼執行過程](https://box.kancloud.cn/72f118edb50010cc108c0579e1d13a2c_791x647.png) ```c struct _zend_module_entry { unsigned short size; unsigned int zend_api; unsigned char zend_debug; unsigned char zts; const struct _zend_ini_entry *ini_entry; const struct _zend_module_dep *deps; const char *name; const struct _zend_function_entry *functions; int (*module_startup_func)(INIT_FUNC_ARGS); int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS); int (*request_startup_func)(INIT_FUNC_ARGS); int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS); void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS); const char *version; size_t globals_size; ... }; zend_module_entry basic_functions_module = { /* {{{ */ STANDARD_MODULE_HEADER_EX, NULL, standard_deps, "standard", /* extension name */ basic_functions, /* function list */ PHP_MINIT(basic), /* process startup */ PHP_MSHUTDOWN(basic), /* process shutdown */ PHP_RINIT(basic), /* request startup */ PHP_RSHUTDOWN(basic), /* request shutdown */ PHP_MINFO(basic), /* extension info */ PHP_STANDARD_VERSION, /* extension version */ STANDARD_MODULE_PROPERTIES }; ``` ## 在代碼中下斷點追蹤一下這幾個步驟 --- ### 基于進程的模型,每個PHP解釋器都被操作系統隔離到自己的進程中.這種模式在Unix下很常見. ![](https://box.kancloud.cn/ec8236cf13fc4be3c2491c8f73b6663a_818x509.png) ### 基于線程的模型,每個PHP解釋器都使用線程庫隔離成一個線程.該模型主要用于Windows操作系統,但也可以與大多數Unix一起使用.這需要PHP及其擴展在ZTS模式下構建. ![](https://box.kancloud.cn/d25190afd49fe54a3947bad0b0576849_812x504.png) 配置編譯PHP時加參數--enable-maintainer-zts則編譯出的php為Zend線程安全(ZTS),否則不是線程安全(NTS)。 當使用pthread(POSIX threads)擴展時,或者當web服務器為Apache2 mpm-worker或IIS使用PHP作為模塊時,請考慮使用ZTS。當使用FastCGI / FPM或Apache2 mpm-prefork時,您不需要ZTS,因為在PHP運行時使用的多進程處理。 NTS是運行PHP的首選方式。NTS還使您更容易編寫和調試擴展。`php -v`查看當前PHP的構建方式,它將在第一行輸出中顯示ZTS或NTS。在較舊的PHP版本中,如果這兩個版本都不顯示,那將是NTS。 --- **參考:PHP代碼執行過程** ![](https://box.kancloud.cn/020d50559e21bc7c49c48e2804d182bf_1193x2284.png) ## 參考資料: http://www.phpinternalsbook.com/php7/extensions_design/php_lifecycle.html http://www.php-internals.com/book/?p=chapt02/02-01-php-life-cycle-and-zend-engine https://github.com/pangudashu/php7-internal/ http://tech.respect-pal.jp/php-helloworld/ https://github.com/luisedware/Archives/issues/1 https://secure.php.net/manual/zh/install.unix.apache2.php http://httpd.apache.org/docs/current/mpm.html https://github.com/tvlooy/php-ext-dev-book
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看