php项目使用xdebug进行调试,配置了launch.json,configurations的env配置项中设置了环境变量,用于在不同的模式下,链接不同的数据库,但是这个配置并没有生效,请问这个应该怎么配置?
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "server and debug (aliyun)",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-S",
"localhost:8000",
"-t",
"."
],
"port": 9003,
"cwd": "${workspaceFolder}/public",
// "preLaunchTask": "set-env-aliyun",
"serverReadyAction": {
"action": "openExternally"
},
"env": {
"HOSTNAME": "xxx.xx.xx.19",
}
},
{
"name": "server and debug (huaweiyun)",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-S",
"localhost:8000",
"-t",
"."
],
"port": 9003,
"cwd": "${workspaceFolder}/public",
// "preLaunchTask": "set-env-huaweiyun",
"serverReadyAction": {
"action": "openExternally"
},
"env": {
"HOSTNAME": "xxx.xx.xx.84"
}
},
{
"name": "server and debug (loc)",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-S",
"localhost:8000",
"-t",
"."
],
"port": 9003,
"cwd": "${workspaceFolder}/public",
// "preLaunchTask": "set-env-loc",
"serverReadyAction": {
"action": "openExternally"
},
"env": {
"HOSTNAME": "127.0.0.1"
}
}
]
}
不知道怎么弄,并没有太多的尝试。