• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

php-debug-apd-调试器

php 搞代码 3年前 (2022-01-23) 15次浏览 已收录 0个评论

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_se

。本文来源gao!%daima.com搞$代*!码网1

搞代gaodaima码t_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


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php-debug-apd-调试器

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址