diff --git a/www/admin/error_test.php b/www/admin/error_test.php
index f9e1aa50..5abf6593 100644
--- a/www/admin/error_test.php
+++ b/www/admin/error_test.php
@@ -11,7 +11,8 @@ if ($DEBUG_ALL) {
// sample config
require("config.inc");
-require(LIBS."Error.Handling.inc");
+echo "FILE: ".BASE.LIB."Error.Handling.inc
";
+require(BASE.LIB."Error.Handling.inc");
if ($var) {
echo "OUT
";
diff --git a/www/lib/Error.Handling.inc b/www/lib/Error.Handling.inc
index 166e14ee..603b4eb0 100644
--- a/www/lib/Error.Handling.inc
+++ b/www/lib/Error.Handling.inc
@@ -8,7 +8,13 @@
*********************************************************************/
// define the base working directory outside because in the function it might return undefined
-DEFINE('CURRENT_WORKING_DIR', getcwd().'/');
+// if we have config set BASE use this
+if (defined('BASE')) {
+ DEFINE('CURRENT_WORKING_DIR', BASE);
+} else {
+ // else we set. We fully assuem that Error.Handling is where it should be, in lib dir
+ DEFINE('CURRENT_WORKING_DIR', str_replace('lib', '', __DIR__));
+}
// METHOD: MyErrorHandler
// PARAMS: $type: the error code from PHP