Login   Register  
PHP Classes
elePHPant
Icontem

Fatal error

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Amazon Mechanical Turk PHP REST API  >  All threads  >  Fatal error  >  (Un) Subscribe thread alerts  
Subject:Fatal error
Summary:Got an error in the amt_rest_api.php file
Messages:3
Author:Bharath V
Date:2014-03-25 17:56:55
Update:2014-03-26 18:10:54
 

  1. Fatal error   Reply   Report abuse  
Picture of Bharath V
Bharath V
2014-03-25 17:56:55
Hello,

I'm using this mturk php APIs for the first time but i keep getting an error as below:

Fatal error: Uncaught exception 'RuntimeException' with message 'Failed to load from URL supplied' in example\lib\amt-rest-api\amt_rest_api.php on line 1481


I am just trying to connect my code to AWS. I have added both the keys to the keys file and added this to the index.php file:

amt\request::set_sandbox_mode();

foreach (new amt\hitlist as $hit) {
var_dump($hit);
}

Am i doing something wrong?


Please help, once i can do this then i can proceed with my actual project.

Thanks in advance.

  2. Re: Fatal error   Reply   Report abuse  
Picture of CPK Smithies
CPK Smithies
2014-03-26 17:19:32 - In reply to message 1 from Bharath V
I don't see that you are doing anything wrong. Here is a minimal program that should work:

<?php
require 'amt_rest_api.php';
amt\request::set_sandbox_mode();
$balance = amt\balance_request::execute();
echo "Balance is $balance\n";
?>

You can run this program from the command line. Let me know if this generates the same error.

  3. Re: Fatal error   Reply   Report abuse  
Picture of CPK Smithies
CPK Smithies
2014-03-26 18:10:54 - In reply to message 1 from Bharath V
If you still experience the same error with the little program I gave in the last reply, then try editing amt_rest_api.php and removing the '@' sign before the file_get_contents() call in line 1475. Then re-run the program and let me know what error was displayed. (N.B. you need to do this from the command line.)