Skip to content
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

PHP version 7.4 #561

Closed
449134904 opened this issue Oct 27, 2023 · 1 comment
Closed

PHP version 7.4 #561

449134904 opened this issue Oct 27, 2023 · 1 comment

Comments

@449134904
Copy link

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.

@GrahamCampbell
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants