The AWS SDK for PHP can be used with Wasabi by simply pointing the endpoint to the Wasabi service URL of https://s3.wasabisys.com
To use the PHP SDK execute the following steps:
1) Install the AWS SDK for PHP
2) Configure additional AWS CLI profile for Wasabi account using the Wasabi keys
Below is a sample php file in which you configure the Wasabi endpoint. In this example we have set the profile name as "wasabi" in the "~/.aws/credentials" file.
// Include the SDK using the Composer autoloader
require '<path for>/vendor/autoload.php';
// Instantiate the S3 client using your Wasabi profile
$s3Client = S3Client::factory(array(
'endpoint' => 'http://s3.wasabisys.com',
'profile' => 'wasabi',
'region' => 'us-east-1',
'version' => 'latest',
//Sample to create a bucket
$s3Client->createBucket(array('Bucket' => '<bucket-name>'));
Note that this example discusses the use of Wasabi's us-east-1 storage region. To use other Wasabi storage regions, please use the appropriate Wasabi service URL as described in this article.