-
-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Certain variables not being loaded #109
Comments
I'm also having a very similar issue. |
Same issue here, Windows 8, EasyPHP with PHP 5.6.4. Seems to vary a bit but can sometimes happen as often as on every 2nd or 3rd request. Doesn't appear to be happening on Mac OS X. From a bit of debugging, it appears the .env file is sometimes not loaded or not available for reading at that point in time. |
+1 Any idea on what might cause the issue? I have done some debugging and found that this only affected getenv in my case. $_ENV and $_SERVER are properly filled. putenv also returns true when setting the variables, but getenv returns false when attempting to get any variable. If I put getenv directly after putenv, getenv works as expected. There seem to have a problem with keeping the value for the whole request. This happens with both load and overload. |
+1 Experiencing intermittent loading of environment variables on Windows 10, WAMP, PHP 5.4. Works probably 99% of the time, then fails on the 1%. Am using $_ENV. |
For some reason when Laravel calls
Dotenv::load()
, the skip on the following line is being called for just four of my .env variables:DB_HOST
,DB_USERNAME
,DB_PASSWORD
,DB_NAME
This is the skip stopping the variable being loaded into
$_ENV
https://github.com/vlucas/phpdotenv/blob/1.1/src/Dotenv.php#L83
After calling the load method, if I call
print_r( $_ENV )
these four values aren't present.This only happens intermittently, for most requests there is no issue.
The host contains dots and the password contains a quote (not at the beginning or end), I doubt this is causing the issue but I thought I'd mention it.
BEFORE calling load, I can get these values using
getenv()
even though they aren't present in$_ENV
or$_SERVER
.I'm using PHP 5.6.8 on windows through XAMPP 3.2.1
The text was updated successfully, but these errors were encountered: