-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
getenv return false after laravel 5.8 update #27913
Comments
How have you defined this in your |
driesvints : Yes DATABASE url is in .env as i haven't update .env file which was working fine in 5.7.I have gone through the changes as well but i haven't fountd any updates regarding getenv() as this is php method not laravel which i think should not be impacted while laravel upgrade. |
Laravel 5.8 will only load environment variables into $_SERVER and $_ENV. It doesn't write into the computer system anymore. That is why the Do not use the |
Thanks @XuanQuynh . |
We have been experiencing the same issue while upgrading to 5.8 in our application, its not necessarily a problem with the Laravel application itself , but does break third party packages that use the native getenv() function. its broken most of the packages. We fixed it by altering the
|
@AndyMac2508 would you mind exposing the packages? Could be useful for others to learn about them before going to 5.8 |
the main one we had an issue with was https://github.com/aws/aws-sdk-php the other ones where internal packages we use. |
@taylorotwell I can't reply to you in the issue you replied to as it's been locked: #27949 (comment) but the fix for that issue is the same as this one, adding a single line as shown listed above here by @AndyMac2508 |
@nomad-software I've unlocked it again |
In my case I run the |
Description:
If you print getenv after laravel 5.8 update it will return false.
Steps To Reproduce:
Upgrade laravel to 5.8.4
Edit /config/database.php
Add dd(getenv('DATABASE_URL')); in the database.php
This will print
false
whereas laravle5.7 was showing exact DB url in format:database://username:password@host:port/database_name
The text was updated successfully, but these errors were encountered: