diff --git a/console.php b/console.php
index 8765b176ac77e9454a6db75ef1921c269d85e120..3c68429cbd49969382f618a83dd6159e7de2e428 100644
--- a/console.php
+++ b/console.php
@@ -45,7 +45,7 @@ function exceptionHandler($exception) {
 	exit(1);
 }
 try {
-	require_once 'lib/base.php';
+	require_once __DIR__ . '/lib/base.php';
 
 	// set to run indefinitely if needed
 	set_time_limit(0);
diff --git a/cron.php b/cron.php
index 68f6a5552d88bbfdef1a0758f06742363fbed41d..a4d2bb8692c531c927763d26c77a13225e47a5ac 100644
--- a/cron.php
+++ b/cron.php
@@ -32,7 +32,7 @@
 
 try {
 
-	require_once 'lib/base.php';
+	require_once __DIR__ . '/lib/base.php';
 
 	if (\OCP\Util::needUpgrade()) {
 		\OCP\Util::writeLog('cron', 'Update required, skipping cron', \OCP\Util::DEBUG);
diff --git a/index.php b/index.php
index 75a2d03fa7abecac3037a610414a802eb0d52827..903b1fd6a76db6eb17d87b712c8df07329055a2f 100644
--- a/index.php
+++ b/index.php
@@ -34,8 +34,8 @@ if (version_compare(PHP_VERSION, '5.6.0') === -1) {
 }
 
 try {
-	
-	require_once 'lib/base.php';
+
+	require_once __DIR__ . '/lib/base.php';
 
 	OC::handleRequest();
 
diff --git a/ocs-provider/index.php b/ocs-provider/index.php
index 20e27e38ce7e3dab984f1e104e22fbc4277df08f..13dfa0b37791325f7b1b3aaec8e15d9b9a047175 100644
--- a/ocs-provider/index.php
+++ b/ocs-provider/index.php
@@ -19,7 +19,7 @@
  *
  */
 
-require_once('../lib/base.php');
+require_once __DIR__ . '/../lib/base.php';
 
 header('Content-Type: application/json');
 
diff --git a/ocs/providers.php b/ocs/providers.php
index be0aff8add22194c3a8e402b120c1abcd33f0be3..9efca14768e89245baa5342fe76781b0910740cb 100644
--- a/ocs/providers.php
+++ b/ocs/providers.php
@@ -23,7 +23,7 @@
  *
  */
 
-require_once '../lib/base.php';
+require_once __DIR__ . '/../lib/base.php';
 
 header('Content-type: application/xml');
 
diff --git a/ocs/v1.php b/ocs/v1.php
index 575b509b012b50e18715e575f0167d01b78c8f26..5aec27ad981c3b20e13f2506a42092c3e4cfae76 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -29,7 +29,7 @@
  *
  */
 
-require_once '../lib/base.php';
+require_once __DIR__ . '/../lib/base.php';
 
 if (\OCP\Util::needUpgrade()
 	|| \OC::$server->getSystemConfig()->getValue('maintenance', false)
diff --git a/ocs/v2.php b/ocs/v2.php
index 45f65033056a010bd8a39fa5a801b0bae6fad065..dc57431e6c6bbb360e8c7602cd700d33b91624d4 100644
--- a/ocs/v2.php
+++ b/ocs/v2.php
@@ -20,4 +20,4 @@
  *
  */
 
-require_once 'v1.php';
+require_once __DIR__ . '/v1.php';
diff --git a/public.php b/public.php
index 48fca3e8c38933fb85b4f599b4bb590dec739f2d..2f86bc92bc6a0d53037c35e076948f7cb66ecb76 100644
--- a/public.php
+++ b/public.php
@@ -29,7 +29,7 @@
  */
 try {
 
-	require_once 'lib/base.php';
+	require_once __DIR__ . '/lib/base.php';
 	if (\OCP\Util::needUpgrade()) {
 		// since the behavior of apps or remotes are unpredictable during
 		// an upgrade, return a 503 directly
diff --git a/remote.php b/remote.php
index d4c321be8025fdfcb62e2e2e38a8ed5d37af8298..e5bd3bb8fed0d7b97ff042712f8dfb1d68516688 100644
--- a/remote.php
+++ b/remote.php
@@ -107,7 +107,7 @@ function resolveService($service) {
 }
 
 try {
-	require_once 'lib/base.php';
+	require_once __DIR__ . '/lib/base.php';
 
 	// All resources served via the DAV endpoint should have the strictest possible
 	// policy. Exempted from this is the SabreDAV browser plugin which overwrites
diff --git a/status.php b/status.php
index e0db479d3e4bb05d755bce8fd3eed7b1bf962a03..a4749bd8b5db5eab575b82ac462f5ae3817f292a 100644
--- a/status.php
+++ b/status.php
@@ -29,7 +29,7 @@
 
 try {
 
-	require_once 'lib/base.php';
+	require_once __DIR__ . '/lib/base.php';
 
 	$systemConfig = \OC::$server->getSystemConfig();