Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined function Moontoast\Math\bcadd() #25

Closed
yushkevichv opened this issue Oct 23, 2018 · 10 comments
Closed

Call to undefined function Moontoast\Math\bcadd() #25

yushkevichv opened this issue Oct 23, 2018 · 10 comments

Comments

@yushkevichv
Copy link

Hi!

After install at laradock receive error Call to undefined function Moontoast\Math\bcadd().

Requirements at docs doesn't say about it nothing.

@yushkevichv
Copy link
Author

rebuild and add bcmath resolve my problem. I think, this information should add to docs

@themsaid
Copy link
Member

moontoast/math already requires ext-bcmath https://github.com/moontoast/math/blob/master/composer.json

@Zerquix18
Copy link
Contributor

Zerquix18 commented Oct 30, 2018

This problem shows because the extension hasn't been loaded. If it hasn't been installed, you'll get this error while trying to install Laravel telescope:

  Problem 1
    - moontoast/math 1.1.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - moontoast/math 1.1.1 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - moontoast/math 1.1.0 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - laravel/telescope v0.1.5 requires moontoast/math ^1.1 -> satisfiable by moontoast/math[1.1.0, 1.1.1, 1.1.2].
    - Installation request for laravel/telescope ^0.1.5 -> satisfiable by laravel/telescope[v0.1.5].

You can install ext-bcmath by running

apt install php7.2-bcmath

(change 7.2 for your PHP version)

Then you can load it by running

sudo service apache2 restart

@yushkevichv
Copy link
Author

I already solve my problem (#25 (comment)) but requirements and docs for this package not have this info. My Issue was about docs.

@guyaloni
Copy link

guyaloni commented Nov 6, 2018

rebuild and add bcmath resolve my problem. I think, this information should add to docs

@yushkevichv, Can you please give more details?
I have exactly the same issue but cannot find out how to solve it!

@yushkevichv
Copy link
Author

@guyaloni try it https://stackoverflow.com/questions/3400362/how-to-install-bcmath-module

I use laradock. It has param. After change need build —no-cache workspace.

@guyaloni
Copy link

guyaloni commented Nov 7, 2018

@guyaloni try it https://stackoverflow.com/questions/3400362/how-to-install-bcmath-module

I use laradock. It has param. After change need build —no-cache workspace.

@yushkevichv, should I do it from docker workspace?

@Ostendorf
Copy link

I had the same issue (running CentOS with PHP 7.1 from Software Collections).

  1. Install bcmath
yum install rh-php71-php-bcmath
  1. Install telescope (which can now install moontoast/math requirement):
composer require laravel/telescope --dev
  1. Then I got the error:
Call to undefined function Moontoast\Math\bcadd()
  1. Because I forgot to reload PHP:
systemctl restart rh-php71-php-fpm

@hileon
Copy link

hileon commented Nov 26, 2018

It is weird to me that all are talking about to install php bcmath extension, while there is no bcadd() function defined on Moontoast\Math class. Which one is actually missing?

@aconital
Copy link

I'm using Laradock and I added these to my php-fpm and it worked:
RUN apt install -y php${LARADOCK_PHP_VERSION}-bcmath && \ docker-php-ext-install bcmath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants