VS Code.
New to this IDE. I have been trying to get Eclipse to work with no luck so I thought I would
check out VS Code see what it's like.
I have a couple of questions about configuration.
How do i set the default document or path to it from the document root in launch.json configuration.
I have just installed VS Code and I'm trying to get a sample website to work.
Here isa configuration cobbled together from some examples already in the launch.json file.
I have no idea what these runtimeArgs mean by the way. It's early days and I can't find a write up.
"configurations": [
{
"name": "Launch Hello PHP",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-S",
"localhost:8081",
"-t",
"."
],
"port": 9003,
"serverReadyAction": {
"action": "openExternally"
}
},
When I run this config I get the following response in the browser.
The url in the browser is "localhost:8081"
The page displays NOT FOUND The resource / was not found on this server.
When I manually change the url in the browser to http://localhost:8081/HelloPHP/index.php the page resolves ok.
But obviously you can't keep doing that every time you run the project.
The PHP $_SERVER["DOCUMENT_ROOT"] produces C:\eclipse-workspace
The getcwd() PHP function produces C:\eclipse-workspace\HelloPHP.
The index.php file is in the C:\eclipse-workspace\HelloPHP folder.
If I change the "localhost:8081" runtimeArg argument to "localhost:8081/HelloPHP/index.php" in the above
configuration the page doesn't resolve.
It says Unable to connect. Firefox can’t establish a connection to the server at localhost:8081.
So obviously that's not a solution.
Hence the questions.
How do i set the default document or path to it from the document root in launch.node js configuration.
In IIS, for example, I would set these values via the site Bindings and Default document.
So what is the equivalent to that in in VS Code is the question.
Thanks and regards
Ray