The document root directory under which the current script is executing, as defined in the server's configuration file.
Questions tagged [document-root]
341 questions
6
votes
2 answers
“Warning: DocumentRoot [/var/www/vhosts] does not exist” although I've created /var/www/vhosts?
I've installed apache and config my virtual host on my CentOS 6.4.
But when i restart apache ( using this command : sudo service httpd restart ) it's warning me that "Warning: DocumentRoot [/var/www/vhosts] does not exist". I've check the directory…

Tấn Triển Nguyễn
- 61
- 1
- 1
- 5
6
votes
2 answers
You don't have permission error in Apache in CentOS
I have installed apache 2.2 in centos 6. Everything worked fine when the apache folder was at its default location /var/www/html. Then I configured a Virtual host inside my users home folder. After that apache started showing Forbidden You don't…

th1rdey3
- 4,176
- 7
- 30
- 66
6
votes
1 answer
is there a better way to go back to the directory root other than using $_SERVER['DOCUMENT_ROOT']?
I'm trying to learn a better way to go back to the root directory. I heard that using $_SERVER isn't the safest way. Im wondering if there is a better way.
so i could get something like this on the url example.com/exp/my.php
here's what i…

Pablo Lopez
- 741
- 1
- 8
- 11
6
votes
2 answers
check file existence from root
I tried the following code to check existence of file in root.
if($res['profile_picture']!="" && file_exists("images/".$res['users_id']."/thumnails/".$res['profile_picture'])){
…

Mohit Tripathi
- 127
- 1
- 7
5
votes
3 answers
A/B Testing with apache and mod_rewrite
Tried searching for this but my google-fu is lacking today.
So I have 2 versions of site, in
/var/www/vhosts/testa.mydomain.com/httpdocs and
/var/www/vhosts/testb.mydomain.com/httpdocs
where each documentroot is pretty much a complete site…

David Shields
- 596
- 1
- 12
- 34
5
votes
3 answers
Apache Main DocumentRoot doesn't exist
I'm trying to find where a reference to /var/www/html still exists in my Apache configuration. When I run apache2ctl -S it says Main DocumentRoot: "/var/www/html", but none of my virual hosts or my main Apache config file point to that directory.
I…

ke4ukz
- 350
- 3
- 10
5
votes
1 answer
jQuery: determine the [server's] Document Root
in PHP you can get the document root by: $_SERVER['DOCUMENT_ROOT']. Ej:
PHP
How can I get the value of…

Omar
- 11,783
- 21
- 84
- 114
5
votes
2 answers
Change document root folder of Apache web server on Linux
My PC is windows 8.1 and Linux mint 16 dual boot pc.I created Local web server on Linux Mint.It's document root is "/var/www".But all my projects are located on a NTFS partion which i mount to linux and use(/media/randika/HardDisk/Works/Lab).I need…

Randika
- 683
- 3
- 11
- 32
5
votes
1 answer
Python PDFMiner error: "No /Root object! - Is this really a PDF?"
I am getting this error "No /Root object! - Is this really a PDF?" using my MAC computer with Python 2.7 and PDFMiner version 20110515.
The pdf files are not damaged because the same program with the same files works on my PC computer! Also I have…

Mahshid Zeinaly
- 3,590
- 6
- 25
- 32
5
votes
3 answers
Differences in declaring your root directory in HTML
This has been bugging me for a long time so I need to ask the question.
What is the difference between / and ./, is it just down to server settings?
For example, if we were looking for an images folder in the root directory we would write:

user1100149
- 266
- 1
- 4
- 12
5
votes
8 answers
Get WordPress installation folder path
Is there a way to get the path to where WordPress is installed?
I was using the following:
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
It is fine for www.example.com -> /usr/local/pem/vhosts/165312/webspace/httpdocs
It is not fine for…

user983248
- 2,588
- 7
- 24
- 44
5
votes
8 answers
MAMP changes to Apache 'document root' are ineffective
I seek help finding why MAMP fails to effect changes to the Apache 'document root', and fixing this problem. This second edit of the original filing includes substantial additional information that may assist in recognition of solutions. …

user1347235
- 51
- 1
- 1
- 4
4
votes
1 answer
Adding Apache VirtualHost, DocumentRoot of localhost changes to the VirtualHost's DocumentRoot
Everything is working perfectly in my Windows 7.
The problem is when I add a domain1.com as VirtualHost, localhost's DocumentRoot changes to VirtualHost's DocumentRoot.
Eg:
When I visit http://localhost, DocumentRoot which I specified for…

Jigar D
- 83
- 1
- 2
- 5
4
votes
7 answers
how to get a path of my working folder in php?
i am new in php.
here i have given my project structure and my working folder name is 'Bookings'.
-Bookings
+Class
+lib
-Public
-application
+controller
+css
…

nic
- 929
- 3
- 14
- 22
4
votes
3 answers
PHP strange DOCUMENT_ROOT
So basically, I'm writing a framework, and as part of it features, it's supposed to provide a set of well-established URIs/paths to the end-developer.
Some two of these paths make use of $_SERVER['DOCUMENT_ROOT']:
/**
* Absolute filesystem path to…

Christian
- 27,509
- 17
- 111
- 155