vampie

Connection error

13 posts in this topic

Hi all,

I'm trying the PHP single authentication example, and I'm getting the following error:

Fatal error: Uncaught exception 'TTransportException' with message 'THttpClient: Could not connect to sandbox.evernote.com:443/edam/user' in /opt/www/path/web/site/transport/THttpClient.php:196 Stack trace: #0 /opt/www/path/web/site/packages/UserStore/UserStore.php(55): THttpClient->flush() #1 /opt/www/path/web/site/packages/UserStore/UserStore.php(35): UserStoreClient->send_checkVersion('PHP EDAMTest', 1, 21) #2 /opt/www/path/web/site/index.php(62): UserStoreClient->checkVersion('PHP EDAMTest', 1, 21) #3 {main} thrown in /opt/www/path/web/site/transport/THttpClient.php on line 196

I've doublechecked the credentials and they seem correct.

I have no clue what could be the reason.

Perhaps because I'm running the script from the browser and not from the console?

Any idea's are welcome.

Thank you.

/edit:

running it from the console works.

How can I make it run from the browser?

Thanks.

Edited by vampie

Share this post


Link to post

That's a networking error (Thrift's TTransportException thrown by the HTTP client), so you're having a problem connecting to our sandbox server. Since it works when you run the script from the command line, I'm assuming that there's some difference in the PHP environment when you run in the browser (presumably via Apache). The most common problem is the SSL configuration of your server - our script is making an outbound HTTPS request, and it may be the case that your SSL client environment isn't trusting our server certificate.

Share this post


Link to post

Thank you for the answer.

So I'm gonne have to check with my host then?

and it may be the case that your SSL client environment isn't trusting our server certificate.

What do you mean with SSL environment?

Is that my browser or is that the apache server?

thank you

Share this post


Link to post

Bummer.

I've changes this:


$evernoteHost = "sandbox.evernote.com";
$evernotePort = "443";
$evernoteScheme = "https";

to that:


$evernoteHost = "sandbox.evernote.com";
$evernotePort = "80";
$evernoteScheme = "http";

And I get the same error:

THttpClient: Could not connect to sandbox.evernote.com/edam/user

:( :( :( :(

Share this post


Link to post

Ok, so it's not an SSL problem. Can you make an outbound connection to sandbox at all from that host? E.g., curl from the command line?

Share this post


Link to post

Hi,

a curl works perfectly even from the site:

I've created a test.php and this shows the index page.


<?php
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "https://sandbox.evernote.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
// grab URL and pass it to the browser
curl_exec($ch);
// close cURL resource, and free up system resources
curl_close($ch);
?>

Share this post


Link to post

I solved the problem:

the setting "allow_url_fopen" was not enabled.

I enabled this for my subdomain and it worked immediately :-)

1 person likes this

Share this post


Link to post

vampie i am facing the same error but my allow_url_fopen is set to on

please can u help me

Share this post


Link to post

Don't ignore transient network issues on the server too! My server's internet provider had trouble today, thus causing this issue.

Share this post


Link to post