phpStudy + PhpStorm + XDebug调试【绝对能用】

具体参照的是这篇文章:https://blog.csdn.net/weixin_40418199/article/details/79088365

文章有些地方说的不是很详细想重写整理下。

 

 

【PHPStudy演示的版本为:PHP5.4.45-Apache】

 

1.PHPStudy配置

PHPStudy自带了XDebug的扩展,不需要下载

phpStudy -> 其它选项菜单-> PHP扩展及设置-> PHP扩展 -> 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"
; IDE与XDebug协作
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\PHPTutorial\php\php-5.4.45\ext\php_xdebug.dll"

 

3.phpStudy配置

1)选择PHP版本

File ->Settings –>languages & Frameworks –> PHP

 

2)Debug端口

“Debug port”与php.ini中xdebug.remote_port值一致

 

4)设置服务器

 

 

3)配置host端口

IDE key与 php.ini中xdebug. idekey值一致

Port与 php.ini中xdebug.remote_port值一致

 

 

5)Run-> Edit Configurations–> PHP Web Application

 

6)增加PHP Web Page

 

 

7)点击小电话图标,打开监听(图中表示已经开启监听)

 

8)打断点

 

 

9)点击调试

 

 

 

效果图: