Title: Using $_SERVER[DOCUMENT_ROOT] in wp-config.php
Last modified: August 20, 2016

---

# Using $_SERVER[DOCUMENT_ROOT] in wp-config.php

 *  [Ivan](https://wordpress.org/support/users/ivansmart/)
 * (@ivansmart)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/using-_serverdocument_root-in-wp-configphp/)
 * I would like to share a word of caution about using $_SERVER[DOCUMENT_ROOT] in
   wp-config.php to point to the plugins directory location as described here: [http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content](http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content)
 * If your site is on a shared hosting, like GoDaddy for example, $_SERVER[DOCUMENT_ROOT]
   might have the path string different from what you get from dirname(__FILE__).
   Both paths are correct, just different because of the links and mounting options,
   and configs used on the hosting system.
 * In my case it did not affect the WordPress in general but caused the problem 
   with contact-form-7 plug-in not being able to resolve the path to its components.
   
   Using define(‘WP_PLUGIN_DIR’, dirname(__FILE__).’/content/plugins’); instead 
   resolved the problem.
 * I believe dirname(__FILE__) is the prefered method since ABSPATH is set the same
   way by WP.
 * _[Moved to Requests & Feedback]_

The topic ‘Using $_SERVER[DOCUMENT_ROOT] in wp-config.php’ is closed to new replies.

## Tags

 * [godaddy](https://wordpress.org/support/topic-tag/godaddy/)
 * [wp-config.php](https://wordpress.org/support/topic-tag/wp-config-php/)

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 0 replies
 * 1 participant
 * Last reply from: [Ivan](https://wordpress.org/support/users/ivansmart/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/using-_serverdocument_root-in-wp-configphp/)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
