Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Path to root in apache (XAMPP)

Tags:

apache

xampp

wamp

I need to set up a path to the site root in a config.php file, eg:

/htdocs/mysite
/xampp/localhost/mysite
/localhost/htdocs/mysite

It doesn't seem to matter what I try it fails to load any files on the path ("failed to open stream: No such file or directory in...").

Do I need something setting in the httpd.conf file for this to work?

like image 210
Owen Avatar asked Mar 15 '11 18:03

Owen


People also ask

Where is root directory in XAMPP?

The document root (web root) directory is located at /opt/lampp/htdocs/ . All files placed in this directory will be processed by the web server. To host other files on your system with XAMPP, you can configure an alias with Apache. Edit Apache's /opt/lampp/etc/httpd.

What is path in XAMPP?

The main XAMPP configuration files are located as follows: Apache configuration file: \xampp\apache\conf\httpd. conf, \xampp\apache\conf\extra\httpd-xampp.

What is document root in XAMPP?

By default, the Web server document root directory (/opt/lampp/htdocs) is configured to only allow write access to the root user. However, in most cases, you will be using XAMPP as a non-root user and this can be inconvenient if you need to quickly modify or add files to your XAMPP installation.

What is the default Dir directory of XAMPP?

In the xampp PHP server, files are served by default from c:/xampp/htdocs directory. There are times when the need may arise for you to serve your PHP project from directories outside of the /htdocs folder eg directly from an external E:/ drive or any other directory on your computer.


1 Answers

I have mine set like this. In xampp/apache/conf/http.conf:

DocumentRoot "C:/xampp/htdocs/drupal/"

You could set yours to something like:

DocumentRoot "C:/xampp/htdocs/mysite/"

If I do this, test.php in my drupal folder, running getcwd() returns

C:\xampp\htdocs\drupal
like image 164
user470714 Avatar answered Sep 21 '22 18:09

user470714