没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
XDebug Support In PDT 2.0
Version: 1.0
Dave Kelsey
Latest Revision: 31 December 2008
This document provides an overview of the features and idiosyncrasies of
XDebug support in PDT (PHP Developer Toolkit)
1 Contents
1 Contents ...................................................................................................................................... 2
2 XDebug Support User Guide ....................................................................................................... 3
2.1 Determining the correct INI file to update .............................................................................. 3
2.2 Required configuration of XDebug ........................................................................................ 3
2.3 Getting debug information. .................................................................................................... 5
2.4 Configuring XDebug support in PDT ..................................................................................... 6
2.4.1 Transfer Encoding ......................................................................................................... 6
2.4.2 Output encoding ........................................................................................................... 7
2.4.3 Step Filtering page ........................................................................................................ 7
2.4.4 Workbench Options ....................................................................................................... 7
2.4.5 Installed Debuggers ....................................................................................................... 8
2.4.6 Multisession ................................................................................................................. 10
2.4.7 Accept Remote Session (JIT) ...................................................................................... 10
2.4.8 Output Capture Settings .............................................................................................. 11
2.4.9 Proxy Support .............................................................................................................. 12
2.4.10 Configuring your web browser ................................................................................... 13
2.4.11 Testing your configuration ......................................................................................... 13
2.5 Debugging using XDebug ................................................................................................... 14
2.5.1 Debugging standalone scripts launched by PDT. ........................................................ 14
2.5.2 Debugging a web based application ............................................................................ 16
2.5.3 Debugging using Remote Session initiation ................................................................ 22
2.5.4 Advanced Path Mapping .............................................................................................. 24
2.6 Breakpoint support .............................................................................................................. 26
2.6.1 Conditional Breakpoint support .................................................................................... 27
2.7 The debug views ................................................................................................................. 29
2.7.1 Strings in the variables view ........................................................................................ 31
2.7.2 Hover ........................................................................................................................... 33
2.7.3 Expression view ........................................................................................................... 33
2.8 Other known issues ............................................................................................................ 34
2.9 Tips ..................................................................................................................................... 35
2.9.1 Launch waiting for debug session ............................................................................... 35
2.9.2 Watch Expressions returning Objects/Arrays .............................................................. 36
Page 2 of 36
2 XDebug Support User Guide
The following versions of XDebug are currently supported
• Official 2.0.0 – 2.0.3 releases
XDebug is available from PECL or http://www.xdebug.org, prebuilt windows
binaries are available and you need to select the appropriate version for the level
of PHP you are running. For Linux, you will need to download the source and
build it yourself. The instructions for this are on http://www.xdebug.org .
This website also provides loads of information about setting up xdebug and
issues with xdebug itself, please visit the website for more information.
2.1 Determining the correct INI file to update
For EXE launches, PDT will take a copy of the INI file stored in the same
directory as the PHP executable, create a copy and will use that copy. Make sure
that you add your Xdebug information to this INI file for launches.
For Web launches, you need to modify the INI file that is used by the version of
PHP that is executed by your web browser. You can determine this file by
invoking a simple script with the following contents
<?php
phpinfo()
?>
and look at the output, specifically the line
Configuration File (php.ini) Path => C:\WINDOWS\php.ini
Which indicates the ini file being used.
2.2 Required configuration of XDebug
The following minimal configuration is required for XDebug in your PHP.INI file if
you are using the thread safe, non debug version of PHP (This is the default
build for the windows binary version on PHP.net).
[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=<hostname>
xdebug.remote_port=<port>
xdebug.remote_handler="dbgp"
zend_extension_ts=<xdebug library location>
Where
• <hostname> is the name of the host where your IDE will be running
• <port> is the port you have configured your IDE to listen on (9000 is the
default)
An example set of entries may look like
[xdebug]
Page 3 of 36
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
zend_extension_ts="C:\php\php_xdebug-2.0.0-5.2.2.dll"
Ensure you place your entries at the bottom of your ini file or XDebug could fail to
load.
You may need to change the “zend_extension_ts” to “zend_extension” if you are
using the non thread safe version of PHP or to “zend_extension_debug” if you
are using the debug version.
To determine if Xdebug has been located successfully, you can either
• launch PHP with the –m option to list the loaded modules
• launch PHP with the –i option to output definition information
• run a PHP script which calls the “phpinfo()” function.
With the –m option you should get something like
[PHP Modules]
bcmath
calendar
...
...
[Zend Modules]
Xdebug
With the –i option and phpinfo you should be looking for the following entries
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with Xdebug v2.0.0, Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, by Der
ick Rethans
As well as information about the XDebug extension and its configuration settings.
xdebug
xdebug support => enabled
Version => 2.0.0
Supported protocols => Revision
DBGp - Common DeBuGger Protocol => $Revision: 1.125 $
GDB - GNU Debugger protocol => $Revision: 1.87 $
PHP3 - PHP 3 Debugger protocol => $Revision: 1.22 $
…
…
Page 4 of 36
If you don’t get this and you are sure the path is correct then you need to make
sure you have the correct entry for zend_extension in your PHP.INI file. When
you do PHP –i or run a script with phpinfo() in it you need to look for 2 entries
Debug Build => no
Thread Safety => enabled
The above output shows a non debug build that has thread safety so you should
use “zend_extension_ts”.
If thread safety was “disabled” then you should have the php.ini entry of
zend_extension=<xdebug library location>
if it was a debug build you need to have the entry
zend_extension_debug=<xdebug library location>
If you are running a thread safe debug version of PHP, then your ini entry must
be of the form
zend_extension_debug_ts=<xdebug library location>
In summary the rule is (in the stated order)
1. start with “zend_extension”
2. if you have a debug build: Debug Build => yes , add “_debug”
3. if you have thread safety: Thread Safety => enabled , add “_ts”
2.3 Getting debug information.
XDebug can generate a log which is useful for debugging. To enable logging you
need to add the following line to php.ini
xdebug.remote_log=<file location>
Page 5 of 36
剩余35页未读,继续阅读
资源评论
kissmumu
- 粉丝: 1
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功