Well I'm stumped. I've been trying to work this out for several hours, plenty of Googles later and nothing. /rant.
I'm new to Auth0 and figured I'd give it a go but I'm getting the error below. I'm using their PHP sample project which you can find here: https://github.com/auth0-samples/auth0-php-web-app/tree/master/00-Starter-Seed/basic-webapp
I've installed composer and installed the dependencies. I've renamed ensured that I have .env setup correctly. I'm running this in XAMPP.
Fatal error: Uncaught Error: Class 'Dotenv\Dotenv' not found in /Users/.../htdocs/oa/dotenv-loader.php:6
I've tried different varations of the dotenv-loader.php show below but with no luck. Does anyone have any advice?
try {
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
} catch(InvalidArgumentException $ex) {
// Ignore if no dotenv
}
// Read .env
$dotenv = new Dotenv\Dotenv('.env');
if(file_exists(".env")) {
$dotenv->load();
}
$dotenv = new Dotenv\Dotenv(__DIR__);
//Check if file exists the same way as dotenv does it
//See classes DotEnv\DotEnv and DotEnv\Loader
//$filePath = $dotenv->getFilePath(__DIR__);
//This method is protected so extract code from method (see below)
$filePath = rtrim(__DIR__, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR . '.env';
if(is_file($filePath) && is_readable($filePath)) {
$dotenv->load();
}
Thanks a lot in advance.