diff --git a/common.php b/common.php index 744b9828f..47742eb42 100644 --- a/common.php +++ b/common.php @@ -63,9 +63,15 @@ function env(string $key, $default = null) return \TorrentPier\Env::get($key, $default); } -// Get initial config -$dotenv = Dotenv\Dotenv::createMutable(BB_PATH); -$dotenv->safeLoad(); +// Load ENV +try { + $dotenv = Dotenv\Dotenv::createMutable(BB_PATH); + $dotenv->load(); +} catch (\Dotenv\Exception\InvalidPathException $pathException) { + die('Please rename from .env.example to .env, and configure it'); +} + +// Load config require_once BB_PATH . '/library/config.php'; // Local config