当前位置:首页 > PHP教程 > php环境安装 > 列表

phpStudy vscode 搭建debug调试的教程详解

发布:smiling 来源: PHP粉丝网  添加日期:2022-03-20 09:25:15 浏览: 评论:0 

这篇文章主要介绍了phpStudy vscode 搭建debug调试的教程,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下。

下载地址

phpstudy:https://www.xp.cn/download.html

vscode:https://code.visualstudio.com/ 设置

phpstudy版本:7.3.4nts

phpStudy vscode 搭建debug调试的教程详解

  1. [Xdebug] 
  2. zend_extension=D:/phpstudy_pro/Extensions/php/php7.3.4nts/ext/php_xdebug.dll 
  3. xdebug.collect_params=1 
  4. xdebug.collect_return=1 
  5. xdebug.auto_trace=On 
  6. xdebug.trace_output_dir=D:/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.trace 
  7. xdebug.profiler_enable=On 
  8. xdebug.profiler_output_dir=D:/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.profiler 
  9. xdebug.remote_enable=On 
  10. xdebug.remote_autostart=On 
  11. xdebug.remote_host=localhost 
  12. xdebug.remote_port=9000 
  13. xdebug.remote_handler=dbgp 
  14. vscode : 

ctrl+,调出setting,或则文件->首选项->设置

phpStudy vscode 搭建debug调试的教程详解

php路径设置

  1. { 
  2.   "window.zoomLevel": 1, 
  3.   "git.confirmSync": false, 
  4.   "git.autofetch": true, 
  5.   "[javascript]": { 
  6.     "editor.defaultFormatter": "vscode.typescript-language-features" 
  7.   }, 
  8.   //关键点 
  9.   "php.validate.executablePath": "D:/phpstudy_pro/Extensions/php/php7.3.4nts/php.exe" 
  10. } 

Xdebug设置

  1. { 
  2.   // 使用 IntelliSense 了解相关属性。  
  3.   // 悬停以查看现有属性的描述。 
  4.   // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 
  5.   "version": "0.2.0", 
  6.   "configurations": [ 
  7.     { 
  8.       "name": "Listen for XDebug", 
  9.       "type": "php", 
  10.       "request": "launch", 
  11.       //端口 
  12.       "port": 9000 
  13.     }, 
  14.     { 
  15.       "name": "Launch currently open script", 
  16.       "type": "php", 
  17.       "request": "launch", 
  18.       "program": "${file}", 
  19.       "cwd": "${fileDirname}", 
  20.       //端口 
  21.       "port": 9000 
  22.     } 
  23.   ] 
  24. } 

验证

phpStudy vscode 搭建debug调试的教程详解

vscode F5启动调试

浏览器输入:localhost/test.php

phpStudy vscode 搭建debug调试的教程详解

Tags: phpStudy搭建debug调试

分享到: