GMP和大量算法的PHP配置 [英] PHP Configuration for GMP and Large Number Arithmetic
问题描述
我正在使用PHP在projecteuler.net上解决一些问题,但是我发现,在当前安装的PHP中,我无法计算足够长或足够大的数字来解决某些问题。
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.
一些关于Stackoverflow以及通过Google的初步研究告诉我,我必须安装PHP扩展名才能进行大量数学运算。建议使用的此类扩展之一是GMP,但我不确定如何配置PHP安装以使用GMP。
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.
我当前正在运行Windows 7 64位,并安装了XAMPP(我认为版本是2.5)。有没有一种方法可以配置我当前的PHP构建以与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?!
推荐答案
首先尝试 bc扩展名。我相信XAMPP上已预装了它。如果这不起作用,请在此处以及有关说明,请此处。
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.
这篇关于GMP和大量算法的PHP配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!