-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
.env file not always being loaded #28571
Comments
What web server are you using? If Apache please specify which MPM you are using (worker, prefork etc). Does the issue persist if you run |
I'm fairly sure this relates to this: #24510 (comment) @driesvints - either this issue, or the other one, should probably be left open, since it's clearly an ongoing issue? Leave it with you to decide what to do given it's not likely to be solved. Perhaps some documentation around it? |
@Garanaw is your issue solved when running |
You should never use "config:cache" on development environment. |
@XuanQuynh he noted |
@XuanQuynh yes but you shouldn't be using I'm suggesting that they try I don't agree that you should never run |
Apologies for the late response, I've been at work. @driesvints when I mentioned @matt-allan It runs in local, I didn't deploy it to production yet. The environment is Wamp64 running on Windows 7, if it gives more info. As for the |
You shouldn't normally run
https://laravel.com/docs/5.8/configuration#configuration-caching I just need you to run The reason I am asking you to run
Their docs don't say what MPM it's using. Can you run It would also be helpful to know what the value of |
Ok, so, here are the loaded modules:
And my I just ran the |
Thanks for the output, that is really helpful. The winnt MPM uses threads. PHP isn't really thread safe, even with thread safety enabled, and the It's likely you are experiencing the same issue as #24510. There are some workarounds detailed in that issue. I'm not sure if Laravel can really do anything about this other than updating the docs to mention this issue. PHP doesn't recommend using a threaded webserver because of issues like this. The standard practice is to only call Laravel tried removing the |
@matt-allan thanks for the response. After a quick read to that issue, and knowing that it's a PHP issue, I guess I can live with it in development, I'll keep an eye on production to disable multi threads though. Thank you |
shouldn't ... is more suitable than should never. I experience that nearly all issues relevant to environment and configuration often cause by cache. I need really care about these things again. @matt-allan Thank you for your clear explanation! |
Closing this as it's been determined that it's a php issue, not a Laravel issue. |
Description:
When doing several ajax requests the .env file is not always being pulled.
Steps To Reproduce:
Using Vue with Axios:
NOTE: This does NOT happen every single time, it happens randomly.
Code for Ajax Requests:
Code in .env file:
Code in config/database.php
Result from the second Ajax request (getLanguages)
NOTE 2: The paths have been modified in this issue for the sake of security
The text was updated successfully, but these errors were encountered: