Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP x64 not supported x64 integer.. (Wamp & dropbox API)

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.

like image 249
AlbertSamuel Avatar asked Nov 14 '13 06:11

AlbertSamuel


2 Answers

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__ . "\"");
}
like image 186
Karuppub Avatar answered Nov 04 '22 21:11

Karuppub


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.

like image 27
steven Avatar answered Nov 04 '22 19:11

steven