0

I am using AWS SDK to use the changeResourceRecordSets feature of the SDK. As mentioned in this document Document I have created folders names "aws" and also ".aws" and placed the credential file inside them. I created these folders in /var/www/html/ as well as /var/www/html/admin where my project is located.

I am trying to connect with the API like this

require 'vendor/autoload.php';
use Aws\Route53\Route53Client;
use Aws\Common\Credentials\Credentials;
$client = S3Client::factory(array(
    'credentials' => array(
        'key'    => 'my key',
        'secret' => 'my secret',
    )
));
echo "<pre>";
print_r($client);
die();

It prints nothing, no error or nothing at all. Can any one please help me and let me know where I am making mistake.

Yunus Aslam
  • 2,447
  • 4
  • 25
  • 39
  • Have you checked your error logs, or tried stepping through the code to see exactly where it fails? – ChristianF Nov 22 '16 at 07:42
  • I checked for error logs. The code doesn't run after I try to create the client. I tried printing in autoload.php to see if it is getting included properly. It prints in auto load but does not print the $client. – Yunus Aslam Nov 22 '16 at 07:47

1 Answers1

0

From your question and comments, I take it that you don't have/use a debugger. So, I'm going to teach you how to fish, instead of directly answering your question. ;)

First of all you need to use a proper debugger, this will allow you to see exactly what happens for each line of code. This will, in turn, allow you to not only see what causes the problem, but also at the specific point in the code where it happens.
In short, it's an invaluable tool for any programmer that's working on anything more complex than simple scripts.

There are a number of debuggers available out there, and a quick web search brings up a whole slew of tutorials (of varying quality, as always). There is also an answer here listing debuggers and how to use them, which I recommend having a look at. If you're using Eclipse, you can also take a look at this tutorial from IBM.
Zend Studio is also an option, should you prefer it.

Community
  • 1
  • 1
ChristianF
  • 2,068
  • 9
  • 14