'Where or how to find the document root when launching localhost

I'm fairly new to programming in general and even more on PHP, so basically I'm following this tutorial on how to print "Hello World" on a localhost but looking at the tutorial I see that the document root is shown when the localhost is launched compared to mine showing less information. So I'm unable to save my program in the right location since i can't seem to figure out where is that document root.



Solution 1:[1]

Your document root is configured in Apache (assuming you use PHP through Apache httpd server here).

Look in your httpd.conf file, you will find directive DocumentRoot, which will show you what directory it uses. It will most probably be something like .../htdocs or .../www or .../html.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nic3500