windowsxampplocationhtdocs

xampp change location of htdocs


Installed xampp-windows-x64-7.4.6-0-VC15 on a reinstalled Windows 10.
Used the default install folder : C:\xampp

I need to point to a different htdocs folder. Instead of C:\xampp\htdocs I need to have my site located in C:\Users\gadib\Dropbox\GADI\xampp\htdocs.

Searched the entire internet (YES, I did!) and all relevant entries suggest that I need to edit 2 lines in C:\xampp\apache\conf\httpd.conf :

Define SRVROOT "C:/xampp/htdocs"
ServerRoot "C:/xampp/htdocs"

and replace C:/xampp/htdocs with the path to the desired folder.

BUT... the 2 lines I have in this file are :

Define SRVROOT "C:/xampp/apache"
ServerRoot "C:/xampp/apache"

Note that these end with apache and not with htdocs !!!

I tried anyway :

Define SRVROOT "C:\Users\gadib\Dropbox\GADI\xampp\htdocs"
ServerRoot "C:\Users\gadib\Dropbox\GADI\xampp\htdocs"

and when starting Apache (via the xampp control panel) it failed with :

Error: Apache shutdown unexpectedly.   etc...

Any idea/hint/suggestion would be very much appreciated.


Solution

  • Update: Sorry if I get you wrong... But if you are talking about the ServerRoot it is very normal to be "C:/xampp/apache" since it is for everyone like that. ServerRoot is the top of the directory tree under which the server's configuration, error, and log files are kept... However the DOCUMENTROOT must be C:/xampp/htdocs For example: DocumentRoot "C:/xampp/htdocs" I hope this will help you out :)