I have the following directory structure:
home/admin/super/
In home I have a file called config.php
<?php
//Get relative path - for PHP files
$documentRoot = $_SERVER['DOCUMENT_ROOT'].'/mwo2015/';
include($documentRoot.'library/constants.php');
echo $paypalID;
?>
and echo $paypalID
is echoed;
In path home/admin/ I have a file called access-control.php
<?php
//Common files
include('../config.php');
?>
and echo $paypalID
is echoed again.
In path home/admin/super/ I have a file called output.php
<?php
include('../access-control.php');
?>
Nothing is output and I get the following error in my error_log of path
PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening '../config.php' for inclusion (include_path='.:/usr/lib64/php:/usr/share/pear')