Hello, I’ve been working on getting a login system up and running for one of my apps. To hide tokens, I’m using a the vlucas/phpdotenv package, which I’ved used in the past with no issues.
Unfortunately, the program refuses to show anything in the .env files. After running print_r($_ENV)
to debug, it was an empty array:
<?php
require __DIR__ . "/vendor/autoload.php";
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
die(print_r($_ENV));
// output is Array ( ) 1
I’ve tried messing around with the createImmutable()
function and giving it the “app” directory but nothing seems to be working. The only errors in the error log is that the index “client” and “secret” cannot be found because $_ENV is a blank array, which it should not be. I’ve used this package on my own server and it works just fine. What is going wrong here?