我已经安装了具有 apache 2.4.4、mysql 5.6.12 和 php 5.4.12 的 WampServer 2.0。当我回显 PHP_INT_MAX 时,它给了我 2147483647。我也回显了 phpinfo() 并且架构指示 x64。这假设不会发生,因为我的 php 是 64 位的,对吗?我需要我的 php 支持 64 位整数。我需要我的 PHP_INT_MAX 为 9223372036854775807。
有人可以帮助我吗?谢谢
在文件RequestUtil.php
中,它执行以下检查:
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__ . "\"");
}
您可以将其注释掉并尝试从那里破解您的方式。
如果我是你,我会使用字符串而不是整数编写自己的 Dropbox API 实现。
PS:但这就是我所做的,所以我很享受:)
试试 PHP7 - 当前的大师http://windows.php.net/downloads/snaps/master/。64 位版本现在利用了 64 位 Windows 的所有功能。
转到 'vendor/dropbox/dropbox-sdk/lib/Dropbox'
并在 RequestUtil.php 中注释第 19-23 行。
评论此部分:
/*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__ . "\"");
}*/
而已。
我尝试了 php7 并且它有效:
running php.exe -r "echo PHP_INT_MAX;"
它输出9223372036854775807