phpStudy + PhpStorm + XDebug调试

1phpStudy配置

phpStudy集成XDebug扩展,所以不用下载XDebug

phpStudy -> 其它选项菜单-> PHP扩展及设置-> PHP扩展 -> Xdebug

phpStudy + PhpStorm + XDebug调试

2修改php.ini文件

[XDebug]

xdebug.profiler_append = 0

 

;效能监测的设置开关

xdebug.profiler_enable = 1

xdebug.profiler_enable_trigger = 0

 

;profiler_enable设置为1的时候,效能监测信息写入文件所在的目录

xdebug.profiler_output_dir="D:\phpStudy\tmp\xdebug"

 

;设置的函数调用监测信息的输出路径

xdebug.trace_output_dir="D:\phpStudy\tmp\xdebug"

 

;生成的效能监测文件的名字

xdebug.profiler_output_name ="cache.out.%t-%s"

 

; IDEXDebug协作

xdebug.remote_enable = 1

xdebug.remote_handler = "dbgp"

xdebug.remote_host = "127.0.0.1"

xdebug.remote_port = 9000

xdebug.idekey = phpstorm-xdebug

 

;.dll文件的路径

zend_extension="D:\phpStudy\php\php-5.4.45-nts\ext\php_xdebug.dll"

 

3、phpstorm配置

1选择PHP版本

文件 ->设置 –>语言和框架 –> PHP

 phpStudy + PhpStorm + XDebug调试

2Debug端口

“Debug port”php.inixdebug.remote_port值一致

 phpStudy + PhpStorm + XDebug调试

3)配置host端口

IDE key php.inixdebug. idekey值一致

Port php.inixdebug.remote_port值一致

 phpStudy + PhpStorm + XDebug调试

 

4)设置服务器

 phpStudy + PhpStorm + XDebug调试


5)运行 -> 编辑配置–> PHP Web Application

 phpStudy + PhpStorm + XDebug调试

 

4、开始XDebug调试

phpStorm里打开监听,就是一个电话一样的按钮,点击变为绿色,在程序代码点前点击,设置程序段点,点击绿色的debug爬虫按钮,chrome浏览器打开xdebug页,phpStorm出现debug窗口,并获取到variables