<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 效能分析工具 APD是高級PHP調試器。它的目的是為PHP代碼提供分析和調試功能,并提供打印完整堆棧回溯的能力。APD支持交互式調試,但在默認情況下,它將數據寫入跟蹤文件。它還提供了基于事件的日志記錄,因此可以為各個腳本打開或關閉不同級別的信息(包括函數調用、傳遞的參數、計時等) >[danger] APD是一個Zend擴展,它修改了PHP內部處理函數調用的方式,因此可能與其他Zend擴展(例如Zend Optimizer)兼容,也可能不兼容 > **已經不再維護了 請使用Xdebug** ini配置: | 名字 | 默認 | 可修改范圍 | 描述| | --- | --- | --- | --- | | apd.dumpdir | NULL | PHP\_INI\_ALL | 設定 APD 寫入調試輸出文件的目錄。可以指定絕對路徑或相對路徑,可以在[apd\_set\_pprof\_trace()](https://www.php.net/manual/zh/function.apd-set-pprof-trace.php)中以參數指定一個不同目錄? | | apd.statement_tracing| "0" | PHP_INI_ALL |指定是否進行每行的跟蹤。將此項打開(設為 1)將影響到程序的性能| 開啟: 1、首先去[package](http://pecl.php.net/package/apd) 下載對用的apd包解壓或者git clone https://github.com/ZeWaren/pecl-apd ``` cd pecl-apd/ phpize configure make && make install //安裝好以后顯示 Installing shared extensions:???? /usr/lib/php5/20131226/ chmod 644 /usr/lib/php5/20131226/apd.so ``` 2、配置php.ini ``` [apd] zend_extension=/usr/lib/php5/20131226/apd.so # 將log寫進/tmp/apd/trace文件夾里 apd.dumpdir = /tmp/apd/trace apd.statement_tracing = 0 ``` >[danger]zend_extension=...而不死extension=... apd.dumpdir 是日志地址 3、 ``` mkdir -p /tmp/apd/trace chmod -R 777 /tmp/apd/ php5enmod apd # 啟用 apd service apache2 reload ``` # 預定義常量[](https://www.php.net/manual/zh/apd.constants.php#apd.constants) | Constant | Value | Description | | --- | --- | --- | | **`FUNCTION_TRACE`**(integer) | 1 | ? | | **`ARGS_TRACE`**(integer) | 2 | ? | | **`ASSIGNMENT_TRACE`**(integer) | 4 | ? | | **`STATEMENT_TRACE`**(integer) | 8 | ? | | **`MEMORY_TRACE`**(integer) | 16 | ? | | **`TIMING_TRACE`**(integer) | 32 | ? | | **`SUMMARY_TRACE`**(integer) | 64 | ? | | **`ERROR_TRACE`**(integer) | 128 | ? | | **`PROF_TRACE`**(integer) | 256 | ? | | **`APD_VERSION`**(string) | example:*1.0.2-dev* | 函數: apd_breakpoint — Stops the interpreter and waits on a CR from the socket apd_callstack — Returns the current call stack as an array apd_clunk — Throw a warning and a callstack apd_continue — Restarts the interpreter apd_croak — Throw an error, a callstack and then exit apd_dump_function_table — Outputs the current function table apd_dump_persistent_resources — Return all persistent resources as an array apd_dump_regular_resources — Return all current regular resources as an array apd_echo — Echo to the debugging socket apd_get_active_symbols — Get an array of the current variables names in the local scope apd_set_pprof_trace — Starts the session debugging apd_set_session_trace_socket — Starts the remote session debugging apd_set_session_trace — Starts the session debugging apd_set_session — Changes or sets the current debugging level override_function — Overrides built-in functions rename_function — Renames orig_name to new_name in the global function table 用法: 1、在PHP腳本的第一行,調用apd\_set\_pprof\_trace()函數來啟動跟蹤,雖然可以在腳本中任何一行插入這一行,但是如果不是從腳本開頭開始跟蹤的話,則丟失了部分數據,有可能造成性能上的瓶頸 2、瀏覽器或者cli運行腳本。轉儲輸出將被寫入ap .dumpdir/pprof_pid.ext,如果運行的是 CGI 版的 PHP,需要加入 '-e' 標記啟用擴展信息以使 APD 正常工作。例如:?**`php -e -f script.php`** 運行腳本后會產生pprof.xxxxx.0,然后再使用 pprofp xxx 來查看即可 分析日志的方法 手冊里這樣寫到 ``` pprofp -R /tmp/pprof.22141.0 ``` 注意這里的pprofp 在你編譯好的 apd的源碼目錄 其實就是一個php文件 這里你要修改pprofp文件開頭的 php路徑 才可以正常執行 php 以cgi方式運行的時候 據說 記著 -e參數 ![](https://img.kancloud.cn/4f/75/4f7546bb3baed81db2dc0ab96671b34e_801x374.png)
                  <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>

                              哎呀哎呀视频在线观看