VS Code(Visual Studio Code)是由微软研发的一款免费、开源的跨平台文本(代码)编辑器。
1.先从官网下载安装好VS Code.官方下载地址是https://code.visualstudio.com/

2.安装PHP套件,这是用的是XAMPP套件(集成Apache,MyS'QL,FileZilla,Mercury,Tomcat等开发环境)。下载链接 https://www.apachefriends.org/zh_cn/index.html

3.打开VS Code,安装 php-debug扩展,Ctrl +P,输入 ext install php-debug 回车,点击安装扩展。

4. 配置用户的设置:

5.配置PHP路径:

将 php.validate.executablePath": "G:/xampp/php/php.exe" 当然,后面的路径要根据XAMPP的安装路径来更改,还有就是要在上条语句后面加个英文状态下的逗号
6.将PHP文件置于Apache的启动目录下:

7.启动Apache服务器:

8. 打开PHP文件,在指定行按F9设置断点然后启动调试.
网友评论