I have a private section within a site with a folder structure like so
My advice is never rely on any external path configuration (such as
DOCUMENT_ROOT). Instead, use paths relative to the current script...
require_once __DIR__ . '/functions.php';
require_once __DIR__ . '/../functions.php';
An alternative might be to set the
include_path for the current environment. You can do this in say a
.user.ini file in your document root
; /home/cpanelLogIn/public_html/.user.ini include_path="/home/cpanelLogIn/public_html/:."
Then you can simply use