phpstorm8 + wamp2.5 调试项目 (xdebug)

一,配置wamp安装目录下的 \bin\apache\apache2.4.9\bin 目录下的php.ini文件,下拉到最下面,配置[xdebug]:

[xdebug]
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "D:/Software/wamp/tmp" (这一行改成自己的目录)
xdebug.show_local_vars=0
xdebug.remote_handler=dbgp
;设置xdebug的端口为9001
xdebug.remote_port = 9001
;设置idekey
xdebug.idekey="PHPSTORM"

Image 013

 

二,在配置具体的项目之前,我们先配置好默认设置(default setting),避免每次建立项目都要进行的重复操作

1.点击File → Default Setting → Languages & Frameworks → PHP  如图:

Image 002

2.弹出interpreters窗口

Image 003

3.

Image 004

4.正常情况下,配置好之后会显示xdebug版本

Image 005

5.设置xdebug端口号

Image 006

6.设置 DBGp Proxy

Image 007

三,默认设置已经设置好,接下来导入或者打开一个工程,开始设置(File → Setting)

1.设置Servers,点击绿色的“+”配置一个新的Server

Image 008

2.接下来设置运行配置(Run → Edit Configuration),设置默认的PHP web application配置

Image 009

3.新建一个php web application

Image 010

4.设置好断点并开始调试

Image 012

5.调试成功,如图:

Image 011

posted @ 2015-07-05 22:03  蒙面  阅读(1108)  评论(0编辑  收藏  举报