Windows10 + IntelliJ IDEA 2017.3.2 + wamp2e + xdebug 调试 配置

一、环境

系统: windows10

WampServer:  wampserver2.2e-php5.3.13-httpd2.2.22-mysql5.5.24-32b.exe

IDE:  IntelliJ IDEA 2017.3.2

Intellij IDEA 如何支持php请参考,IntellIJ IDEA 配置 Vue 支持

二、xdebug配置

1.配置 wamp 安装目录下的php.ini文件,D:wampinapacheapache2.2.22inphp.ini ,编辑内容如下:

;开启远程调试
xdebug.remote_enable = on
xdebug.profiler_enable = on
xdebug.profiler_enable_trigger = on
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "D:/wamp/tmp"

xdebug.show_local_vars=0
;远程处理协议
xdebug.remote_handel=dbgp
;端口号
xdebug.remote_port=9001
;IDE KEY
xdebug.idekey="phpxdebug"

三.IntelliJ IDEA配置

1.打开需要debug的项目,选择 File -》 Settings :

2.配置php的执行文件路径、和当前版本:

3.添加本地php可执行路径

点击应用后,选择刚才配置好的php路径配置:

4.配置xdebug,填写上文在php.ini中设置好的端口号:

5.配置DBGp Proxy参数:

6.配置你需要调试的web应用地址:

7.设置当前web application的 Run/Debug Configurations, 点击IDE的右上角,点击编辑配置信息:

8.添加一个PHP Web Application:

9.打开xdebug 监听开关,在需要调试的地方设置断点:

到这一步已经大功告成了,点击右上角的 debug 按钮开始调试!

注意:

IDE开启了xdebug监听的话,访问该web应用,会自动激发debug动作。无需手动点击IDE的debug按钮。

记得请一真打开 xdebug 监听,否则在非调试情况下访问web应用会很慢。

可能是xdebug会向外广播调试数据,没有接收者响应的话,会轮询各个网络吧,所以导致响应慢,这纯属个人猜测。

PS:

PhpStorm+xdebug+postman调试

原文地址:https://www.cnblogs.com/phpdragon/p/8528936.html