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?
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.
The main XAMPP configuration files are located as follows: Apache configuration file: \xampp\apache\conf\httpd. conf, \xampp\apache\conf\extra\httpd-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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With