PHP Script not proceeding ahead with Amazon S3 Upload
<p>I am trying to upload a file to the Amazon S3 using the AWS PHP SDK but whenever I try uploading, the script gives output till the PutObject operation but no output after that operation. I am not even able to dump the result object. The credentials are stored in the <code>.aws</code> in the <code>root</code> folder of my test machine (running Ubuntu). Below is the code -</p>

<pre><code>$s3 = new Aws\S3\S3Client([
        'version' =&gt; 'latest',
        'region' =&gt; 'us-east-1'
    ]);

echo "&lt;br /&gt;".realpath(UPLOAD_DIR . $apiKEY . "/" . $name);
        try {
        $result = $s3-&gt;putObject([
            'Bucket' =&gt; 'quicklyusercannedspeechbucket',
            'ContentType' =&gt; 'text/plain',
            'Key' =&gt; $apiKEY . "/" . $name,
            'SourceFile' =&gt; realpath(UPLOAD_DIR . $apiKEY . "/" . $name)
        ]);
         var_dump($result);
    }
    catch(\Aws\S3\Exception\S3Exception $e) {
        echo $e-&gt;getAwsErrorCode();
    }
    echo "Finished";
    var_dump($result);
</code></pre>

<p>When I run the above code, I don't get any output for the $result array. Any idea what might be happening?</p>

<p>Any help is appreciated ^_^</p>

<p>-Pranav</p>