Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
884 views
in Technique[技术] by (71.8m points)

windows - php 64 bit with php_int_max = 2147483647

I have install WampServer 2.0 that has apache 2.4.4, mysql 5.6.12, and php 5.4.12. When I echo PHP_INT_MAX it gave me 2147483647. I have also echo phpinfo() and the architecture indicates x64. This suppose to be not happening because my php is 64 bit right? I need my php to support 64 bit integer. I need my PHP_INT_MAX to be 9223372036854775807.

Can somebody help me? Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you're running a windows OS, wampServer suggests you are, this is your answer:

On windows x86_64, PHP_INT_MAX is 2147483647. This is because in the underlying c-code, a long is 32 bit.

Note that this doesn't mean that Windows doesn't support 64bit int's: int64_t does exist, but it's not used by PHP AFAIK.
I've managed to come up with this link, on that page, there's some code you might be able to use, to add support for 64bit ints to your code


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...