Knowledge Base Glossary   
Search  
   
Browse by Category
Knowledge Base .: Web Programming .: PHP .: What is the DOCUMENT_ROOT value set to?

What is the DOCUMENT_ROOT value set to?

Our document root is set to /var/www. This can present issues when you use short cuts in your code such as this:

$_SERVER['DOCUMENT_ROOT'].'/includes/top.php';

This will look to /var/www/includes/top.php, which does not exist. The correct method would be to define the document_root as:
$_SERVER['DOCUMENT_ROOT'] = '/mnt/Target01/123456/www.mydomain.com/web/content/';

Please see How do I find the server-side path for my site?

You can set this in a config file and then include it into any other files that require it.

How helpful was this article to you?

User Comments

Add Comment
No comments have been posted.


.: Powered by Lore 1.5.6