I am trying to use XAMPP with NetBeans for PHP. When I move my files to the htdocs folder everything works fine. However when they are in the home folder XAMPP cannot find them. Below is the instruction from XAMPP I followed it but it’s not working.
**Where should I put my Websites?**
You can put your Websites in /Applications/XAMPP/htdocs/
and access them via http://localhost/
Or you put your Websites in the Sites-Folder in your Home
and access them via http://localhost/~leslie/.
You can change your document root pretty easily by following these instructions:
httpd.conf. Mine is located in this directory:/Applications/XAMPP/etcFind the line that says:
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"Change the path to where you want your files to live. Use an absolute path from the root directory (i.e. it should start with a
/and if you’re using Unix/Linux and a\if you’re on Windows).Still in the
httpd.conffile, scroll down a few lines until you see this text:and replace the path with whatever you typed in step 3.
This part is important. In order for these changes to take place, you need to restart Apache (otherwise it won’t work). Since you’re using XAMPP, just use the GUI to do this (click Stop, and then Start next to the Apache label).
Now, you can put your web content in the new directory (i.e. the home folder in your case)
If, on the other hand, you want to add an additional directory to serve files from, locate the
httpd.conffile mentioned in step 1 above, and add this line:Restart Apache
Now, you can visit
localhost/homein your browser and it will serve files from your home directory in addition to the files in your document root (htdocs by default, or whatever you change it to using the steps above).