Question: what's the best method for dynamically obtaining a parent directory, e.g. the parent directory to the document root?
Answer: quite simple
// PARENT DIR: dirname(dirname($path_to_file))
  # parent to current file
  dirname(dirname(__FILE__))
  # parent to document root (outside web tree)
  dirname($_SERVER['DOCUMENT_ROOT'])
source: 
php.net