Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

when do you need an htdocs

Posted on 2014-01-22
5
Medium Priority
?
218 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 336 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 111

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 332 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 35

Assisted Solution

by:gr8gonzo
gr8gonzo earned 332 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 count occurrences of each item in an array.
Suggested Courses

618 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