This is a common issue and there is a relatively easy we to resolve it. One way is to create a php file in your website's root directory (we'll call it loader.php) and put something like:
define( 'ROOT_PATH', dirname(__FILE__) . '/' );
Then at the top of all your first layer php files...