diff --git a/libs/load.php b/libs/load.php
index 624935ef0acf14e1d8d63426a61a82cceb635eb6..8a69a827540b70112278bf1f16dea5d287a84bd6 100644
--- a/libs/load.php
+++ b/libs/load.php
@@ -8,7 +8,8 @@ include_once 'includes/UserSession.class.php';
 global $__site_config;
 // global $__base_path;
 //Note: Change this path if you run this code outside lab.
-$__site_config = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/../photogramconfig.json');
+$__site_config_path = dirname(is_link($_SERVER['DOCUMENT_ROOT']) ? readlink($_SERVER['DOCUMENT_ROOT']) : $_SERVER['DOCUMENT_ROOT']).'/photogramconfig.json';
+$__site_config = file_get_contents($__site_config_path);
 // $__base_path = get_config('base_path');
 Session::start();