我正在为客户重新设计一个网站。他们为我提供了服务器登录,我可以通过FTP下载所有文件。我将它们全部上传到Heroku但我遇到了这个错误:
Fatal error: Uncaught Dotenv\Exception\InvalidPathException: Unable to
read the environment file at /var/www/public/.env. in
/var/www/public/vendor/vlucas/phpdotenv/src/Loader.php:76 Stack trace:
#0 /var/www/public/vendor/vlucas/phpdotenv/src/Loader.php(52):
Dotenv\Loader->ensureFileIsReadable() #1
/var/www/public/vendor/vlucas/phpdotenv/src/Dotenv.php(91):
Dotenv\Loader->load() #2
/var/www/public/vendor/vlucas/phpdotenv/src/Dotenv.php(48):
Dotenv\Dotenv->loadData() #3 /var/www/public/inc/config.php(11):
Dotenv\Dotenv->load() #4 /var/www/public/index.php(2):
require('/var/www/public...') #5 {main} thrown in
/var/www/public/vendor/vlucas/phpdotenv/src/Loader.php on line 76
这是Loader.php文件的第73-78行:
protected function ensureFileIsReadable()
{
if (!is_readable($this->filePath) || !is_file($this->filePath)) {
throw new InvalidPathException(sprintf('Unable to read the environment file at %s.', $this->filePath));
}
}
最后.env有来自前一个开发人员的db信息,但如果我想做的只是设计更改,我是否需要更改这些值?