本地没报错,放到linux上报
Call to undefined function bcadd() 
这个不是标准函数么,怎么会未定义哦?请高手来解答一下,如何解决

解决方案 »

  1.   

    1. 看一下php是什么版本2. 看一下php.ini里有没启用, 再用phpinfo();  查看bcmath.scale项的值是不是 "0" 和 PHP_INI_ALL  
      

  2.   

    是php5
    看一下php.ini里有没启用---??启用什么
      

  3.   

    ./configure --enable-bcmath 提示:-bash:   ./configure:   No   such   file   or   directory 
    怎麼回事?
      

  4.   

    你打phpinfo();看看
    这是bcadd()能运行的官方配置http://cn2.php.net/manual/en/bc.configuration.php
      

  5.   

    phpinfo(),显示的结果是什么都没有
      

  6.   

    php.ini里面
    [bcmath]
    ; Number of decimal digits for all bcmath functions.
    bcmath.scale = 0是不是把0改成 PHP_INI_ALL 就可以了?
      

  7.   

    有网上说在php编译的时候
    ./configure --enable-bcmath 就可以了。
    我试了,报 -bash: ./configure no such file or directorylinux菜鸟,崩溃中。
      

  8.   

    php.ini里面 
    [bcmath] 
    ; Number of decimal digits for all bcmath functions. 
    bcmath.scale = 0 -------------------
    这是开启的配置,
    打phpinfo();之后有一项叫bcmath的  名字为BCMath support 值为enabledlinux不是本来就自带的吗?
      

  9.   

    Since PHP 4.0.4, libbcmath is bundled with PHP. You don't need any external libraries for this extension.默认是应该绑定的,编译的时候加上--enable-bcmath就应该启用了.
    实在没办法,就自己下载个libbcmath装上吧.
      

  10.   

    ./configure --enable-bcmath 
    我试了,报 -bash: ./configure no such file or directory 
      

  11.   

    ---------------------
    我echo phpinfo();后在本地是有名字为BCMath support 值为enabled
    可在服务器上找不到bcmath项
      

  12.   


    缺少了那个模块, 或者你编译时可能出错, 如上楼, 你重将一次php看看
      

  13.   

    谢谢楼上的楼上两位用phpinfo()之后,终于有所悟
    在linux上装上bcmath就,再phpinfo()之后就有BCMath support 值为enabled 了
    终于OK了。