phpstorm debug

复制自己的phpinfo粘贴到https://xdebug.org/wizard.php中, 会生成需要下载的版本, 

下载好之后放入php目录的ext文件夹中, 然后设置php.ini, 在最后加上

xdebug.idekey="PHPSTORM"
xdebug.remote_enable=on
xdebug.remote_autostart=on
xdebug.auto_trace=On
xdebug.scream=off
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir ="D:\phpStudy\PHPTutorial\tmp\xdebug"
xdebug.trace_output_dir ="D:\phpStudy\PHPTutorial\tmp\xdebug"
xdebug.profiler_output_name = "cache.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9001
zend_extension="D:\phpstudy\PHPTutorial\php\php-7.1.13-nts\ext\php_xdebug-2.7.2-7.1-vc14-nts.dll"

然后重启apache, 去设置phpstorm。

1.设置php

phpstorm debug

 

phpstorm debug

2.DBGp  proxy

phpstorm debug

3.services

phpstorm debug

4. 端口

phpstorm debug

设置完毕,点OK退出。

点菜单栏的Run>Edit Configurations… 在弹出的窗口中添加一个调试配置:

phpstorm debug