Solved

when do you need an htdocs

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

Accepted Solution

by:
Ray Paseur earned 84 total points
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now