好吧,我被难住了。我已经尝试了几个小时来解决这个问题,后来我搜索了很多谷歌,但什么也没找到。/rant。
我是Auth0的新手,我想我应该试一试,但我得到了下面的错误。我使用的是他们的PHP示例项目,您可以在这里找到:https://github.com/auth0-samples/auth0-php-web-app/tree/master/00-Starter-Seed/basic-webapp
我已经安装了composer并安装了依赖项。我已经重命名,确保我有正确的.env设置。我在XAMPP中运行它。
Fatal error: Uncaught Error: Class 'Dotenv\Dotenv' not found in /Users/.../htdocs/oa/dotenv-loader.php:6我尝试了下面dotenv-loader.php显示的不同变体,但没有成功。有人有什么建议吗?
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();
}在此之前非常感谢。
发布于 2016-11-19 05:06:32
在阅读谷歌的登录应用程序接口后,我意识到无论你的composer.json在哪里,你都需要运行'composer install‘,这似乎已经解决了这个问题。如果不是这样,我会更新的。
https://stackoverflow.com/questions/40684677
复制相似问题