Question

I've developed a small Dropbox based app. I've done all the coding in PHP using symfony 1.4 and the dropbox-php library. Locally on my machine everything works just fine. But on a public test server the the dropbox-php library fails to retrieve the request tokens.

The app key and app secret are the same on both machines and I'm using the PHP OAuth extension as the OAuth library. The Dropbox App is in development mode and I've also enabled additional users for it from the Dropbox App Dashboard.

Not sure if this helps but here's the piece of code:

$oauth = new Dropbox_OAuth_PHP(sfConfig::get('app_dropbox_app_key'), sfConfig::get('app_dropbox_app_secret'));
$tokens = $oauth->getRequestToken();

...and this the exception thrown:

500 | Internal Server Error | Dropbox_Exception_RequestToken We were unable to fetch request tokens. This likely means that your consumer key and/or secret are incorrect.

From the error message it looks like the the app key and app secret combination is wrong. But the combination is right since it works on my machine and I've been using it for days to develop this small app. The 43 port is open on the server and the php_oauth.dll is loading correctly.

Any ideas about what I'm doing wrong here?

Was it helpful?

Solution

I've switched to Dropbox_OAuth_Curl but it didn't work either. The error:

Curl error: (77) error setting certificate verify locations:
CAfile: rootca
CApath: none

So I've set:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

And it works. Can this be somehow related to Dropbox_OAuth_PHP not working?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top