小米粒儿的杀阡陌 發表於 2019-5-5 18:26:00

VScode 搭建PHP环境

<p>先按照这个搭建</p><p>使用Visual Studio Code搭建PHP调试环境</p><p><br></p><p>要注意的几个点</p><p>上文中的4.2. 配置Visual Studio Code&nbsp; 指定php的路径</p><p><img src="https://img2018.cnblogs.com/blog/782227/201905/782227-20190505150838207-1939729458.png"></p><p><br></p><p><img src="https://img2018.cnblogs.com/blog/782227/201905/782227-20190505162240724-1345311433.png"></p><p><br></p><p>配置 PHP Debug</p><p><img src="https://img2018.cnblogs.com/blog/782227/201905/782227-20190505162301423-1564178345.png"></p><p>配置完成后 文件夹下后有个 .vscode 文件夹 下有个 launch.json</p><p><img src="https://img2018.cnblogs.com/blog/782227/201905/782227-20190505162325447-750572315.png"></p><p>内容如下</p><blockquote><p>{</p><p>// 使用 IntelliSense 了解相关属性。 </p><p>// 悬停以查看现有属性的描述。</p><p>// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387</p><p>"version": "0.2.0",</p><p>"configurations": [</p><p>{</p><p>"name": "Listen for XDebug",</p><p>"type": "php",</p><p>"request": "launch",</p><p>"port": 9000</p><p>},</p><p>{</p><p>"name": "Launch currently open script",</p><p>"type": "php",</p><p>"request": "launch",</p><p>"program": "${file}",</p><p>"cwd": "${fileDirname}",</p><p>"port": 9000</p><p>}</p><p>]</p><p>}</p></blockquote><h1><font color="#ff0000">特别说明&nbsp;&nbsp; PHP Debug必须通过打开文件夹中的文件才能调试</font></h1><h1><font color="#ff0000">必须要打开www目录 把你要调试的代码放在这个目录下</font></h1><p><img src="https://img2018.cnblogs.com/blog/782227/201905/782227-20190505162436180-540690807.png"></p><p><br></p><p>端口要用WAMP给定的 而不是vscode的launch.json中的9000</p><p><img src="https://img2018.cnblogs.com/blog/782227/201905/782227-20190505162826495-1829196931.png"></p><p><br></p><p><br></p><p>打断点调试</p><p><img src="https://img2018.cnblogs.com/blog/782227/201905/782227-20190505182627492-482315076.png"></p><br><br>
来源:https://www.cnblogs.com/xtxtx/p/10815440.html
頁: [1]
查看完整版本: VScode 搭建PHP环境