Closed celsomtrindade closed 11 months ago
I don't understand what your question is here?
(FYI getenv
is almost always the wrong choice, and will be broken if you are using php-fpm, for ~1-0.01% of requests, depending on server setup due to concurrency bugs - getenv is not threadsafe)
I think the issue is that the aws sdk uses getenv
to load the aws system credentials. The solution, I think is to load the credentials manually or, if your code is hosted on aws ec2, to use an ec2 role to provide access.
You can request that we use getenv and putenv as per https://github.com/vlucas/phpdotenv?tab=readme-ov-file#putenv-and-getenv
Is it possible to load AWS environment variables with this lib?
I used to use .env file, but on AWS they have these variables which seems to be best choice, specially because of my CI/CD worflow. Now I want to load from AWS Secrets Manager.
The way I was able to make it work, at least for now, was to disable the usage of this lib and directly use
getenv()
.Thanks