1. VSCODE  安装插件 PHP Debug( Debug supprot for PHP with XDebug);

2. 下载php_xdebug扩展文件dll,需要与PHP版本匹配,然后放到PHP目录下的EXT文件夹中;下载地址:https://xdebug.org/download.php

vsCode 添加php 的调试环境 nginx 服务器

 

 

3. 修改PHP.INI文件,在文件尾部添加如下代码:

[Xdebug]
zend_extension=php_xdebug-2.5.5-5.6-vc11-nts-x86_64.dll
xdebug.auto_trace=On
xdebug.collect_params=On
xdebug.collect_return=On
xdebug.profiler_enable=on
xdebug.trace_output_dir="C:\phpdebug"
xdebug.profiler_output_dir="C:\phpdebug"
xdebug.remote_enable = on
xdebug.remote_host ="127.0.0.1"
xdebug.remote_port = 9003(此端口号需与launch.json中的端口号保持一致)
xdebug.remote_autostart = on

4.重启PHP;

5:在php 的执行路径下进行版本测试 ,输入命令 : php -v

vsCode 添加php 的调试环境 nginx 服务器

 

可以用

证明,下载的调试版本与安装的版本一致。

6.在VSCODE中的PHP文件下断点,调试下拉框选择Listen for XDebug, 按F5;

7.在浏览器中打开你的刚才下断点的页面,OK,VSCODE中已经断下来了,尽情的调试吧。。哈哈

相关文章:

  • 2021-11-12
  • 2021-12-28
  • 2021-11-21
  • 2021-06-27
  • 2021-11-04
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2021-06-26
  • 2021-11-05
  • 2021-11-07
  • 2021-11-18
  • 2021-11-28
相关资源
相似解决方案