php-debug-apd-調試器

來源:互聯網
上載者:User
http://www.phpq.net/doc/php/ref.apd.php
http://pecl.php.net/package/apd


簡介

APD 是 Advanced PHP Debugger,即進階 PHP 調試器。是用來給 PHP 代碼提供規劃與錯誤修正的能力,以及提供了顯示整個堆棧追蹤的能力。
APD 支援互動式錯誤修正,但預設是將資料寫入追蹤檔案。它還提供了基於事件的日誌,因此不同層級的資訊(包括函數調用,參數傳遞,計時等)可以對個別的指令碼開啟或關閉。

APD 是一個 Zend 擴充庫,修改了 PHP 內部處理函數調用的方式,因此有可能與其它 Zend 擴充庫(例如 Zend Optimizer)不相容。


安裝

APD 目前作為一個 PECL 擴充,可以從 » http://pecl.php.net/package/apd 得到。確保安裝了 CGI 版的 PHP 並且在目前的目錄下可以運行,以及可以運行 phpize 指令碼。

運行以下命令以下載,編譯並安裝最新穩定版的 APD:

pear install apd

這將自動把 APD Zend 擴充安裝到 PHP 擴充庫目錄中。不是一定要放到那裡,可以將此模組存放到任何 PHP 可以讀取的目錄中,只要正確設定了相應的 zend_extension 參數即可。

Windows 使用者可以從 » http://snaps.php.net/win32/PECL_STABLE/ 下載擴充庫的 DLL 檔案 php_apd.dll。

在 INI 檔案中,加入下面幾行:

zend_extension = /absolute/path/to/apd.so
apd.dumpdir = /absolute/path/to/trace/directory
apd.statement_tracing = 0

根據 PHP 版本,zend_extension 指令可以是以下之一:

zend_extension (non ZTS, non debug build)
zend_extension_ts ( ZTS, non debug build)
zend_extension_debug (non ZTS, debug build)
zend_extension_debug_ts ( ZTS, debug build)


方法

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 ? Starts the session debugging
apd_set_session ? Changes or sets the current debugging level
apd_set_socket_session_trace ? Starts the remote session debugging
override_function ? Overrides built-in functions
rename_function ? Renames orig_name to new_name in the global function table
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.