具体下载网址我放到下面
VScode:Visual Studio Code - Code Editing. RedefinedVisual Studio Code - Code Editing. RedefinedVisual Studio Code - Code Editing. Redefined
phpstudy:小皮面板(phpstudy) - 让天下没有难配的服务器环境! (xp.cn)
以本人为例:
本人将php安装在D:\software\computing\NSP\phpstudy路径下
php.ini文件夹则在D:\software\computing\NSP\phpstudy\phpstudy_pro\Extensions\php\php7.3.4nts路径下
注意:你要寻找对于php版本的phpx.x.xnts文件夹
如果各位找不到后缀名,在导航窗口中点击查看,将文件扩展名勾选即可
[Xdebug]
zend_extension=D:/phpstudy_pro/Extensions/php/php7.3.4nts/ext/php_xdebug.dll
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=On
xdebug.trace_output_dir=D:/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.trace
xdebug.profiler_enable=On
xdebug.profiler_output_dir=D:/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.profiler
xdebug.remote_enable=On
xdebug.remote_autostart = On
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
注意:端口最好不要用9000,不然会跟Nginx冲突
文件 ----> 首选项 ----> 设置
在其中添加自己安装的php路径
一定要确定自己的安装路径是否正确!!!
"php.debug.executablePath": "D:\\software\\computing\\NSP\\phpstudy\\phpstudy_pro\\Extensions\\php\\php7.3.4nts.\\php.exe",
"php.validate.executablePath": "D:\\software\\computing\\NSP\\phpstudy\\phpstudy_pro\\Extensions\\php\\php7.3.4nts\\php.exe"
PHP Debug
PHP Intelephense
PHP Xdebug
注意:PHP Xdebug 如下图所示的错误,可以选择安装旧版本0.6
test文件夹一定要放在php安装路径的WWW文件夹中
{
"configurations": [
{
"name": "Launch current script in console",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"externalConsole": false,
"port": 9001
},
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9001
}
]
}
在php中打开Apache
再次刷新即可
将正在使用的php加入环境变量。因为phpstudy默认是没有将php加入环境变量钟的,结果就是无论你怎么写配置都注定以失败告终,而且没有错误提示。