Solved

when do you need an htdocs

Posted on 2014-01-22
5
205 Views
Last Modified: 2014-01-22
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?

Thanks.
0
Comment
Question by:centem
5 Comments
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 84 total points
ID: 39799980
Not required at all.  Are you putting your PHP scripts on a live server on the internet or running them locally on a laptop?
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39800017
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!
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html
0
 

Author Comment

by:centem
ID: 39800068
I am running them locally with wamp server. Does that make a difference?
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 83 total points
ID: 39800105
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.
http://tuxninja18.wordpress.com/2012/05/24/how-to-change-default-wamp-document-root-directory/
On Windows you wouldn't have /var/www/html - that is a Linux directory format.
0
 
LVL 34

Assisted Solution

by:gr8gonzo
gr8gonzo earned 83 total points
ID: 39800129
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.
0

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question