Closed 449134904 closed 10 months ago
That is correct. Because getenv and putenv are not threadsafe, they are typically considered a security risk when using them when running in php-fpm. As such, we default to not calling putenv. This is documented in the first bullet point in https://github.com/vlucas/phpdotenv/blob/master/UPGRADING.md#v4-to-v5 and also at https://github.com/vlucas/phpdotenv?tab=readme-ov-file#putenv-and-getenv.
Hello, I was using PHP version 7.4. When I used version 4.2.0 of vlucas/phpdotenv, I could retrieve the contents of the .env file using getenv. However, when I upgraded to vlucas/phpdotenv version 5.5, I could no longer retrieve the contents using getenv, and had to use $_ENV instead.