phpstorm + xdebug调试

phpstorm + xdebug调试

准备工做php

  • wamp开启xdebugweb

  • chrome安装xdebug helperchrome

wamp配置xdebug

在php设置 里面启用xdebug扩展, 配置以下phpstorm

; XDEBUG Extension
zend_extension = "D:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
;
[xdebug]
xdebug.remote_enable = On
xdebug.remote_handler=dbgp
xdebug.remote_host= localhost
xdebug.remote_port = 9000
xdebug.idekey="PHPSTORM"

在chrome里面安装xdebug helper

在chrome web store里面搜索xdebug,找到Xdebug helper扩展安装ide

phpstorm 配置

  1. 确保phpstorm里面xdebug的port也是9000(同wamp的xdebug端口) : File>Setting在搜索框里面搜索xdebugspa

  2. 打开右上角的配置,以下图所示
    图片描述debug

  3. 新建配置
    新建配置调试

  4. 配置截图
    配置截图code

*说明 个人wamp的www目录下有一个API的项目,我要调试这个项目, 那么在配置的host里面应该配置为 localhost/API/orm

调试

在项目的某个地方打断点,确保配置为当前项目的配置地址, 使能调试, 按调试
图片描述
在网页上面也要进行简单的配置
图片描述

刷新,就会进入断点了
F8 下一步
F9 恢复运行

enjoy it

至于怎么下载chrome, 登陆应用商店,再也不本文的讨论范围以内