Hello guys I am so confused I dont know what I am doing wrong this told me Fatal error: Class \'Dotenv\\Dotenv\' not found in
But I dont understand
Be sure that you are using Dotenv after loading from vendor/autoload.php
.
For example, I was using OpenCart, in which contained a file startup.php
with:
// Autoloader
if (file_exists(DIR_VENDOR . 'autoload.php')) {
require_once(DIR_VENDOR . 'autoload.php');
}
And I had defined DIR_VENDOR
in config.php
as:
define('DIR_VENDOR', __DIR__.'/vendor/');
So finally, in index.php
, I would have:
// Startup
require_once(DIR_SYSTEM . 'startup.php');
// dotenv
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
So startup.php
loads vendor/autoload.php
, which loads vlucas/phpdotenv
, after which we can then find Dotenv\Dotenv
.