首页 > 解决方案 > Call to undefined function App\Http\Controllers\bcmul() in laravel 5.5

问题描述

Here is My code bcmul is undefined but my concern bcmul is php function using for Multiply two arbitrary precision numbers. but laravel show undefined why?

  public function confirmBtcRequest(Request $request,$id){

    $getBalanceInfo = $this->bitcoin->get_balance();
    $sendAmount = bcmul($getBalanceInfo->data->available_balance, '0.01', 8); 
    print_r($sendAmount);
    die;
}

if You have any idea please respond me.

标签: laravelbitcoin

解决方案


According to PHP documentation, BCMath is not available by default with PHP7 on Linux servers.

bcmath ist not installed automatically with php 7 on linux (ubuntu server) You have to use: sudo apt-get install php-bcmath

Please install it using apt-get: sudo apt-get install php-bcmath

Source: http://php.net/manual/en/bc.installation.php


推荐阅读