Solved

when do you need an htdocs

Posted on 2014-01-22
5
202 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
paypal ipn to mysql 3 38
How to stop user from going back to a previous page in PHP 3 33
Blocking submission of a web-based form 6 20
How would I do this...? 2 28
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

810 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