In S3 doesn't exist the concept of folder. What you see as folder in S3 console is just an illusion of folder.
Since each object accept / in the key, you can simulate a folder hierarchy (i.e: images/myphoto.jpg) but the filesystem is still flat.
S3 console simulate for you the folder hierarchy, but this notion is file-related, so you can't use putBucket, but putObject with a proper key:
From AWS Doc:
use Aws\S3\S3Client; $bucket = '*** Your Bucket Name ***'; $keyname = 'images/photo.jpg'; // $filepath should be absolute path to a file on disk $filepath = '*** Your File Path ***'; // Instantiate the client. $s3 = S3Client::factory(); // Upload a file. $result = $s3->putObject(array( 'Bucket' => $bucket, 'Key' => $keyname, 'SourceFile' => $filepath, 'ContentType' => 'text/plain', 'ACL' => 'public-read', 'StorageClass' => 'REDUCED_REDUNDANCY', 'Metadata' => array( 'param1' => 'value 1', 'param2' => 'value 2' ) )); echo $result['ObjectURL'];