發現我一個項目,我嘗試運行它,但我得到一個以下錯誤:試圖執行期間PHP致命錯誤:類「Dotenv」不
PHP Fatal error: Class 'Dotenv' not found in `/home/maras/Documents/eCodile/debtorcare/server/bootstrap/app.php on line 5`
我與這個錯誤掙扎a php artisan start
我試圖重新安裝所有的依賴關係,但沒有奏效。 我剛剛試圖根據我在互聯網上發現的其他類似問題運行一些命令,但其中任何一個都起作用。我試着即:
composer require vlucas/phpdotenv --prefer-dist
Ive得到了一個文件.env
。
這是放置錯誤文件:
<?php
require_once __DIR__.'/../vendor/autoload.php';
Dotenv::makeMutable();
Dotenv::load(__DIR__.'/../');
Dotenv::makeImmutable();
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| Here we will load the environment and create the application instance
| that serves as the central piece of this framework. We'll use this
| application as an "IoC" container and router for this framework.
|
*/
$app = new Laravel\Lumen\Application(
realpath(__DIR__.'/../')
);
是否有可能錯誤與數據庫或phpMyAdmin的錯誤的配置連接?或者,也許我已經把.env放在了錯誤的地方?
我嘗試在開發中運行此項目。
我可以通過什麼方式檢查CWD? –
我之前也嘗試過'composer dump-autoload',但它沒有幫助 –