Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 681
Raushan Singh Avatar asked Dec 01 '22 10:12

Raushan Singh


2 Answers

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

like image 167
hktang Avatar answered Dec 03 '22 23:12

hktang


bcmul() is a function in php. This error means that the php version on your server has not been compiled with the necessary library, called BC Math (http://php.net/manual/en/book.bc.php). You need to talk to your server admin about this.

like image 42
MD. Jubair Mizan Avatar answered Dec 03 '22 23:12

MD. Jubair Mizan