今天正好要用到bcadd()函数,结果报错,百度下原因是没有安装bcmath扩展。
那就安装呗,搜了一下,我是yum安装的php7.2,扩展也可以yum来安装
啊,yum真是个伟大的工具
好,我们开始
1.键入命令 (72W就是php版本,不加有一定的几率报错)
yum install php72w-bcmath
回车;
2.ok,安装完毕,重启服务器 Nginx
或者 Apache就行了,你看奏是这么简单!
ps:当然建议还是重启下服务器,比如我重启Nginx就没效果(难道是重启一下php-fpm?),不管他了,重启得了!
shutdown -r now #立刻重启 ps:centos7