10

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.

3
  • share your Route,view and model if any. Commented Nov 21, 2018 at 13:03
  • 1
    You might need to install BCMath php.net/manual/en/bc.installation.php Commented Nov 21, 2018 at 13:07
  • 1
    ok i try..to install bcmath Commented Nov 21, 2018 at 13:08

2 Answers 2

26

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

Sign up to request clarification or add additional context in comments.

Comments

4

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.