使用 php.ini 启用 BCMath?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16217871/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 10:44:19  来源:igfitidea点击:

Enable BCMath using php.ini?

phpbcmath

提问by David Levine

I need to enable BC Math, but I don't want to do it using --enable-bcmath, primarily because I don't understand that route.

我需要启用 BC Math,但我不想使用 --enable-bcmath 来执行此操作,主要是因为我不了解该路线。

Is there a way to do this using php.ini only?

有没有办法只使用 php.ini 来做到这一点?

回答by mlewis54

To the best of my knowledge you must compile php with the --enable-bcmath option. Without it, the required code won't exist in the binary. Therefore, there is nothing that you can set in php.ini

据我所知,您必须使用 --enable-bcmath 选项编译 php。没有它,二进制文件中将不存在所需的代码。因此,您无法在 php.ini 中设置任何内容

回答by David Levine

Before recompiling, check the php.ini file and search for "bcmath". You may find bcmath.scale=0. If so, change the 0 to a 2.

在重新编译之前,检查 php.ini 文件并搜索“bcmath”。您可能会发现 bcmath.scale=0。如果是这样,请将 0 更改为 2。