18

I am trying to connect to the Dropbox API with WAMP x64 installed.

This is the exception from the Dropbox authentication file that I got from this Dropbox php API

Fatal error: Uncaught exception 'Exception' with message 'The Dropbox SDK uses 64-bit integers, but it looks like we're running on a version of PHP that doesn't support 64-bit integers (PHP_INT_MAX=2147483647). Library: "C:\Users\Albert\Desktop\www\test\dropbox-sdk\Dropbox\RequestUtil.php"' in C:\Users\Albert\Desktop\www\test\dropbox-sdk\Dropbox\RequestUtil.php on line 15

and I checked my PHP version, it says

Architecture x64

What should I do to get my Dropbox application to work? Thanks a lot.

jasonlam604
  • 1,456
  • 2
  • 16
  • 25
AlbertSamuel
  • 584
  • 10
  • 33
  • Are you running on a 32-bit hardware ? e.g. 32-bit CPU ? Read more at: http://stackoverflow.com/questions/864058/how-to-have-64-bit-integer-on-php – Raptor Nov 14 '13 at 06:09

2 Answers2

48

Just comment the following line in \lib\Dropbox\RequestUtil.php(line.no : 19)

if (strlen((string) PHP_INT_MAX) < 19) {
//    // Looks like we're running on a 32-bit build of PHP.  This could cause problems because some of the numbers
//    // we use (file sizes, quota, etc) can be larger than 32-bit ints can handle.
   throw new \Exception("The Dropbox SDK uses 64-bit integers, but it looks like we're running on a version of PHP that doesn't support 64-bit integers (PHP_INT_MAX=" . ((string) PHP_INT_MAX) . ").  Library: \"" . __FILE__ . "\"");
}
felipe.zkn
  • 2,012
  • 7
  • 31
  • 63
Karuppub
  • 502
  • 5
  • 5
  • Thanks. Helpful to me and saved a lot of time – Rahul Oct 14 '15 at 08:35
  • Thank you.. I just check it again, and accepted this as answer. – AlbertSamuel Mar 22 '16 at 22:44
  • This is in fact the workaround suggested by one of Dropbox team members. You guys can check out this [thread](https://www.dropboxforum.com/hc/en-us/community/posts/201823725-Fatal-error-Uncaught-exception-Dropbox-Exception-NetworkIO-with-message-Error-executing-HTTP-request-error-14094410-SSL-routines-SSL3-READ-BYTES-) – Fahmi Jun 22 '16 at 22:19
11

it seems to be the case that Windows doesn't support 64bit integers:

how to have 64 bit integer on PHP? (second answer)

Note that PHP on Windows does not support 64-bit integers at all, even if both the hardware and PHP are 64-bit...

Maybe you should configure a linux-vm with for example a 64bit debian version on your windows machine. I think its anyway the best practice to work with a VM instead of installing WAMP on windows. Its stable, independent, portable and you don't have to deal with windows specific issues.

Community
  • 1
  • 1
steven
  • 4,868
  • 2
  • 28
  • 58