php 7.4 sdk - is_readable(): open_basedir .aws/config

0

Hello we upgraded our php sdk and now we are getting the following messages. We are using IAm roles on our ec2 instances and not credentials, so we do not even have a config file setup. Why is the SDK wanting access to a config file? Is there another way to resolve these messages? I have searched around and the only thing I find is to create a config file.

php 7.4

PHP SDK 3.209

Warning: is_readable(): open_basedir restriction in effect. File(/usr/share/httpd/.aws/config) is not within the allowed path(s): (/var/www/vhosts/mysites.com:/tmp/) in /httpdocs/apps/vendor/aws/aws-sdk-php/src/Endpoint/UseFipsEndpoint/ConfigurationProvider.php on line 133

Warning: file_exists(): open_basedir restriction in effect. File(/usr/share/httpd/.aws/config) is not within the allowed path(s): (/var/www/vhosts/mysites.com:/tmp/) in /httpdocs/apps/vendor/aws/aws-sdk-php/src/Credentials/CredentialProvider.php on line 816

asked 2 years ago415 views
1 Answer
0

Hello,

from which version of SDK did you update?

PHP SDK uses default credential provider chain where credentials from file (default is ~/.aws/config) are checked before credentials from role attached to instance.

Since you have open_basedir restriction and you want to get rid of that warning - you can either specify a custom (eve non-existing) config file within your allowed open_basedir path or customize credential provider.

answered 2 years ago
  • Hello, we are updating from 3.179. I failed to mention are also setting up a new instance on linux 2, and this warning started showing up.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions