前言
最近学php一直有一个问题,不知道在哪写,光学不练也不是个问题,所以就在网上搜索在哪里能写php,结果搜到的全是教我怎么搭环境的,给我说PhpStudy等什么什么哪个好。。。我只是个搞安全的,搭个环境不至于吧,所以写篇文章,讲一讲怎么直接在VS Code上完成php的学习并且运行php代码。
个人觉得练习写php挺重要的,最近刷Web题的时候经常需要自己编译Python、php什么的,计算payload或者漏洞复现,所以下载VS Code很有必要。
下载VS Code
可以直接在官网搜索,也可以点这个链接:VS Code官网 进去了是一个这个页面,直接点击【Download for Windows】就行,如果是其他系统也可以下拉选择  之后会进入这个页面,一般稍等一会就会自己下载了,如果长期没有反应,可以点击【direct download link】下载  VS Code的安装就是无脑下一步,没啥特别的,当然尽量不要安装到C盘
安装插件
中文支持
一般进来后会自动提醒你安装中文插件,之间安装 重启 就行  如果没有提醒,可以点击左边第四个按钮,搜索【Install language】,点击【Install】就行,记得 重启 
代码提示
继续搜索【PHP IntelliSense】,点击【安装】,当他出现 禁用、卸载 标志时,代表安装好了,然后 重启 一下  之后写php的时候就会有语法提示了,体验会更好  其他功能可以在【文件】-【首选项】-【设置】中设置 
内置浏览器
继续搜索【open in browser】,安装操作同上,别忘了 重启  他可以让你直接打开浏览器访问你写的html 
运行php代码
搜索【code Runner】,安装后 重启  它可以让你直接在VS Code 上运行php代码 
PHP sever
安装【PHP sever】,左边的都是我安装的插件 
总结
总算能跑起来了,人已经跑不动了,希望 php 跑的开心、跑的愉快
|