0x01 环境

phpstorm phpstudy Windows10

0x02 配置过程

1.下载对应的xdebug.dll
将PHPINFO内容复制到http://xdebug.org/wizard
2.配置php.ini,添加如下配置

  1. [XDebug]
  2. xdebug.profiler_output_dir="D:\phpStudy1\PHPTutorial\tmp\xdebug"
  3. xdebug.trace_output_dir="D:\phpStudy1\PHPTutorial\tmp\xdebug"
  4. zend_extension = D:\phpStudy1\PHPTutorial\php\php-7.2.1-nts\ext\php_xdebug-2.9.8-7.2-vc15-nts.dll
  5. xdebug.auto_trace=1
  6. xdebug.collect_params=1
  7. xdebug.collect_return=1
  8. xdebug.profiler_enable = 1
  9. xdebug.profiler_output_name = "cachegrind.out.%t.%p"
  10. xdebug.remote_enable = 1
  11. xdebug.remote_handler = "dbgp"
  12. xdebug.idekey = PHPSTORM
  13. xdebug.remote_host = "127.0.0.1"
  14. xdebug.remote_port = 9001

3.phpstorm配置
配置位置 File | Settings | Languages & Frameworks | PHP
image.png
配置位置 File | Settings | Languages & Frameworks | PHP | Debug
image.png
配置位置 File | Settings | Languages & Frameworks | PHP | Debug | DBGp Proxy
image.png
配置位置 File | Settings | Languages & Frameworks | PHP | Servers
image.png
配置位置 Run | + | PHP Web Page
image.png