Owen
Owen

Reputation: 7577

Path to root in apache (XAMPP)

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?

Upvotes: 12

Views: 108869

Answers (1)

user470714
user470714

Reputation: 2888

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

Upvotes: 15

Related Questions