1、xdebug下载:http://xdebug.org/download.php,xdebug版本根据php版本和php是否ts下载。
php是否ts可通过phpinfo()查看Zend Extension Build
将下载下来的dll放到php目录的/ext下,并重命名为:php_xdeubg.dll
2、在php.ini中配置xdebug
zend_extension = "e:/wamp/bin/php/php5.3.10/ext/php_xdebug.dll"
[xdebug]
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 17000
xdebug.profiler_enable = true
xdebug.profiler_enable_trigger = true
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "e:/wamp/tmp"
3、在eclipse pdt中配置debug
4、eclipse 的debug configuration
FAQ:waiting for xdebug session 57%错误的解决方法:
1)由于php.ini中xdebug.remote_host 为127.0.0.1,因此访问地址必须为http://127.0.0.1,如果为http://localhost则会出现这个错误;
2)如果配置以后还是不行,可能是9000端口被占用了,将php.ini中的xdebug.remote_port改为其他值,修改了php.ini后,还需要在eclipse做相应的修改: