PHP Configuration for GMP and Large Number Arithme

2019-07-26 22:48发布

问题:

I'm using PHP to do some of the problems on projecteuler.net, but I have found that with my current installation of PHP, I cannot compute numbers long or large enough to do some of the problems.

Some initial research on Stackoverflow and through Google has told me that I must install an extension to PHP in order to do math with very large numbers. One such extension that was suggested is GMP, but I am not entirely sure how to configure my PHP installation to use GMP.

I am currently running Windows 7 64-bit with an installation of XAMPP (I think the version is 2.5). Is there a way to configure my current PHP build to work with GMP? How?!

回答1:

First try the bc extension. I believe that comes pre-installed on XAMPP. If that doesn't work, the requirements for GMP are here and the instructions are here.