You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled upon an issue in my environment where calls to env() would intermittently fail to return the expected value.
Ultimately, I root caused this to the use of getenv() within that function, which is not thread safe in PHP. Under high server load scenarios where multiple requests are being processed concurrently, I can consistently reproduce this.
I fixed this by using the following:
general_helper.php
Avoid relying on getenv() function and use one of the two other methods exposed by Dotenv.
I stumbled upon an issue in my environment where calls to env() would intermittently fail to return the expected value.
Ultimately, I root caused this to the use of getenv() within that function, which is not thread safe in PHP. Under high server load scenarios where multiple requests are being processed concurrently, I can consistently reproduce this.
I fixed this by using the following:
general_helper.php
Avoid relying on getenv() function and use one of the two other methods exposed by Dotenv.
Either:
Or:
Env.php
Once the above change is made, you would no longer need the unsafe version of dotenv's create functions.
The text was updated successfully, but these errors were encountered: