Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Use Amazon S3 Multi-Region Access Points with the AWS SDK for PHP Version 3 - AWS SDK for PHP

Use Amazon S3 Multi-Region Access Points with the AWS SDK for PHP Version 3

Amazon Simple Storage Service (S3) Multi-Region Access Points provide a global endpoint for routing Amazon S3 request traffic between AWS Regions.

You can create Multi-Region Access Points using the SDK for PHP, another AWS SDK, the S3 console, or AWS CLI,

Important

To use Multi-Region Access Points with the SDK for PHP, your PHP environment must have the AWS Common Runtime (AWS CRT) extension installed.

When you create a Multi-Region Access Point, Amazon S3 generates an Amazon Resource Name (ARN) that has the following format:

arn:aws:s3::account-id:accesspoint/MultiRegionAccessPoint_alias

You can use the generated ARN in place of a bucket name for getObject() and putObject() methods.

<?php require './vendor/autoload.php'; use Aws\S3\S3Client; // Assign the Multi-Region Access Point to a variable and use it place of a bucket name. $mrap = 'arn:aws:s3::123456789012:accesspoint/mfzwi23gnjvgw.mrap'; $key = 'my-key'; $s3Client = new S3Client([ 'region' => 'us-east-1' ]); $s3Client->putObject([ 'Bucket' => $mrap, 'Key' => $key, 'Body' => 'Hello World!' ]); $result = $s3Client->getObject([ 'Bucket' => $mrap, 'Key' => $key ]); echo $result['Body'] . "\n"; // Clean up. $result = $s3Client->deleteObject([ 'Bucket' => $mrap, 'Key' => $key ]); $s3Client->waitUntil('ObjectNotExists', ['Bucket' => $mrap, 'Key' => $key]); echo "Object deleted\n";
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.