title: SSL Certification issue cURL error 60 and Error executing "PutObject"
body: <p>I am trying to send a <code>.txt</code> file to an s3bucket in AWS but whenever I run my code using mamp I get the following error:</p>
  
  <blockquote>
    <p>Error:Error executing "PutObject" on "<a href="https://dynamics-bucket-qa.s3.eu-west-2.amazonaws.com/folder/Test.txt" rel="nofollow noreferrer">https://dynamics-bucket-qa.s3.eu-west-2.amazonaws.com/folder/Test.txt</a>"; AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see <a href="http://curl.haxx.se/libcurl/c/libcurl-errors.html" rel="nofollow noreferrer">http://curl.haxx.se/libcurl/c/libcurl-errors.html</a>)</p>
  </blockquote>
  
  <p>I have placed <code>cacert.pem</code> file which I downloaded from the internet in the <code>extra/ssl</code> folder in MAMP and I have also updated the <code>php.ini</code> file with this <code>curl.cainfo = "C:\MAMP\bin\php\php7.2.10\extras\ssl\cacert.pem"</code></p>
  
  <p>After all this, it still does not work. I've been trying for a long time but haven't managed to fix it. I'm pretty new to all this.</p>
  
  <p>I'm using PHP version 7.2.10 </p>
  
  <pre><code>&lt;?php
  
  // Run:$ composer require aws/aws-sdk-php
  require '../vendor/autoload.php';
  
  
  use Aws\AwsClient;
  use Aws\Exception\AwsException;
  
  // AWS Info
  $bucketName = 'dynamics-bucket-qa';
  $IAM_KEY = 'XXXXXXXXXXXXXXXXXXXXXXX';
  $IAM_SECRET = 'XXXXXXXXXXXXXXXX';
  // Connect to AWS
  try {
      // You may need to change the region. It will say in the URL when the bucket is open
      // and on creation.
      $s3 = Aws\S3\S3Client::factory(
          array(
              'credentials' =&gt; array(
                  'key' =&gt; $IAM_KEY,
                  'secret' =&gt; $IAM_SECRET
              ),
              'version' =&gt; 'latest',
              'region'  =&gt; 'eu-west-2'
          )
      );
  } catch (Exception $e) {
  
      die("Error: " . $e-&gt;getMessage());
  }
  
  // For this, I would generate a unqiue random string for the key name. But you can do whatever.
  $keyName = 'folder/' . basename($_FILES["fileToUpload"]['name']);
  $pathInS3 = 'https://s3.eu-west-2.amazonaws.com/' . $bucketName . '/' . $keyName;
  // Add it to S3
  try {
      // Uploaded:
      $file = $_FILES["fileToUpload"]['tmp_name'];
      $s3-&gt;putObject(
          array(
              'Bucket'=&gt;$bucketName,
              'Key' =&gt;  $keyName,
              'SourceFile' =&gt; $file,
              'StorageClass' =&gt; 'REDUCED_REDUNDANCY'
          )
      );
  } catch (S3Exception $e) {
      die('Error:' . $e-&gt;getMessage());
  } catch (Exception $e) {
      die('Error:' . $e-&gt;getMessage());
  }
  echo 'Done';
  
  //htdocs composer -v 
  ?&gt;
  </code></pre>