It's fast and easy, and you can get in contact with others straight away...

Enter a Display Name
Enter your full name or a display name. Businesses, couples and families are also accepted. e.g.
Model Trains Inc.,
Sam and Janis Allen
Enter a username
Your username must be at least 6 characters in length, contain both letters and numbers and end in a number, but can not contain spaces or other characters.
Suggested usernames:
Password strength:
Your password can be up 250 characters in length and can contain letters, numbers, punctuation marks and spaces.
Hint: a secure password is long but easy to remember and not complex, e.g.
Jules Verne is an excellent author
Retype password
Enter the same password again to check for errors.

By signing up you agree to our Terms of Use & Privacy Policy

 

    When AWS Looks For Credentials In The Root Folder


    We encountered what appeared to be a strange bug when getting the credentials needed to connect to an S3 service.

    The official documentation on Amazon mentions a plain text file located in ~/.aws/credentials will be read to obtain the access/secret key pair for identification to an S3 server.

    However, when we tried this setup, we found this in Apache's error_log instead:

    [03-Jan-2022 20:49:35 Australia/Sydney] PHP Fatal error:  Uncaught AwsExceptionCredentialsException: Cannot read credentials from /.aws/credentials in /home/mirrorisland/public_html/aws/Aws/Credentials/CredentialProvider.php:875
    Stack trace:
    ...
    
    (The stack trace was a list of functions from the AWS sdk for PHP)

    At first glance, it seems that AWS is looking for .aws/ from the root folder. To try this on our home server we copied .aws/ to the root folder on a development laptop--and--it worked!

    But it shouldn't have. No sensible framework would try to read from the root of any drive in a shared environment, especially Amazon's.

    After a bit of digging around it turns out the AWS sdk does try to look in the user's home folder, by using the HOME environment variable and prepends the HOME variable to /.aws/credentials. Unfortunately for us, it wasn't set on our server. This isn't the fault of Amazon's sdk, but our server not having an environment variable configured.

    So, with a null HOME env, what was supposed to be /home/mirrorisland/.aws/credentials ended up being /.aws/credentials.

    At this point it was obvious what we had to do. Since /home/mirrorisland was missing from the above path, adding the following line to .htaccess made everything work.

    SetEnv HOME /home/mirrorisland
    

    Problem solved.
    View As
    Sort by
    Sign In or Sign Up to reply.
    Cancel esc
    Click for advanced permissions.
    View
    Edit
    Reply
    Approve
    Moderate
    Tags
    Visibility
    ·
    Replies
    General
    Content Suitability
    Show Replies As
    Sort Replies By ·
      Paste Link Undo Redo ctrl enter

    Loading
    Loading...

    Loading messages...
    Visibility
    ( )
    Content Suitability
    Replies
    Click for advanced permissions.
    View
    Edit
    Reply
    Approve
    Moderate
    Tags

    Attach an image or file

    Cancel esc
    Cancel esc