• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

when do you need an htdocs

I am new to php and a lot of tutorials and books reference the htdocs directory but I am able to create sites with in the /var/www/html directory without the need for an htdocs directory.

When do I really need an htdocs dir? Is it required on a site?

3 Solutions
Ray PaseurCommented:
Not required at all.  Are you putting your PHP scripts on a live server on the internet or running them locally on a laptop?
Ray PaseurCommented:
Also, if you're new to PHP, this article can help steer you to some good learning resources and away from the outdated and terrible examples that litter the internet!
centemAuthor Commented:
I am running them locally with wamp server. Does that make a difference?
That is just the default directory that WAMP and others use.
You can set it to whatever you like - just look for documentroot in httpd.conf and change the virtual host folder.
On Windows you wouldn't have /var/www/html - that is a Linux directory format.
htdocs is just a common name for the folder that contains your web content. There's nothing special about the actual name. The thing that actually matters is what your web server is set up to use. Your web server's configuration is what dictates what folder it is going to use.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now