Php-debug-apd-Debugger

Source: Internet
Author: User
Tags apd php debugger stack trace zts
http://www.phpq.net/doc/php/ref.apd.php
Http://pecl.php.net/package/apd


Brief introduction

APD is an advanced PHP Debugger, which is a premium PHP debugger. is the ability to provide planning and error correction for PHP code, as well as the ability to display the entire stack trace.
APD supports interactive error correction, but by default it writes data to a trace file. It also provides event-based logging, so different levels of information (including function calls, parameter passing, timing, and so on) can be turned on or off for individual scripts.

APD is an Zend extension library that modifies the way PHP internal processing functions are called, and therefore may not be compatible with other Zend extension libraries (such as Zend Optimizer).


Installation

APD is currently extended as a PECL and can be obtained from»HTTP://PECL.PHP.NET/PACKAGE/APD. Make sure that the CGI version of PHP is installed and running in the current directory, and that you can run the Phpize script.

Run the following command to download and compile and install the latest stable version of APD:

Pear Install APD

This will automatically install the APD Zend extension into the PHP extension Library directory. Not necessarily put there, you can store this module in any directory that PHP can read, as long as the corresponding zend_extension parameters are set correctly.

Windows users can download the DLL file php_apd.dll of the extension library from»http://snaps.php.net/win32/pecl_stable/.

In the INI file, add the following lines:

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

Depending on the PHP version, the zend_extension directive can be one of the following:

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)


Method

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