phpstrom+wampserver+xdebug配置
2018-04-28 本文已影响138人
10xjzheng
1. xdebug
我自己的wampserver 3.0已经集成了xdebug扩展,只需在php.ini将其配置成如下即可:
[xdebug]
zend_extension ="D:/wamp/bin/php/php7.0.10/zend_ext/php_xdebug-2.4.1-7.0-vc14-x86_64.dll"
xdebug.default_enable=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.max_nesting_level=100
xdebug.profiler_enable=on
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_connect_back=on
xdebug.idekey=PHPSTORM
xdebug.collect_vars=on
xdebug.profiler_enable_trigger_value=PHPXDEBUG
xdebug.profiler_enable_trigger=1
xdebug.show_mem_delta = 1
xdebug.trace_format = 1
xdebug.auto_trace=on
xdebug.trace_output_dir=D:\wamp\tmp\xdebug
xdebug.profiler_output_dir=D:\wamp\tmp\xdebug
2. phpstrom设置
2.1 CLI解释器配置
在File>Settings>PHP设置如下(我自己用的是php7):

添加解释器要确认xdebug已启用:

2.2 设置server

2.3 设置XDebug

2.4 设置DBGp Proxy

2.5 配置web Application

3 断点调试

4 调试相关操作
- step into:单步执行,遇到子函数就进入并且继续单步执行
- step over:在单步执行时,在函数内遇到子函数时不会进入子函数内单步执行,而是将子函数整个执行完再停止,也就是把子函数整个作为一步。
- step out:当单步执行到子函数内时,用step out就可以执行完子函数余下部分,并返回到上一层函数。