Call to undefined function bcadd(). How to install bcmath
How to Install bcmath PHP module
PHP Fatal error: Uncaught Error: Call to undefined function bccomp()
PHP Fatal error: Uncaught Error: Call to undefined function bcdiv()
PHP Fatal error: Uncaught Error: Call to undefined function bcmod()
PHP Fatal error: Uncaught Error: Call to undefined function bcpowmod()
PHP Fatal error: Uncaught Error: Call to undefined function bcpow()
PHP Fatal error: Uncaught Error: Call to undefined function bcscale()
PHP Fatal error: Uncaught Error: Call to undefined function bcmul()
PHP Fatal error: Uncaught Error: Call to undefined function bcsqrt()
PHP Fatal error: Uncaught Error: Call to undefined function bcsub()
My site failed to load and I saw the above error “PHP Fatal error: Uncaught Error: Call to undefined function bcadd()” when I accessed my website in the web browser.
Bcmath PHP extension might not be enabled on your server and that might be reason why you got this error.
Do the below steps to install bcmath on your server.
Steps to Install bcmath module on Ubuntu or Debian Server
1. Log into your Ubuntu or Debian server as ‘root’ user or as any user with sudo privileges.
2. Run the command ‘dpkg --list | grep -i bcmath’ to check whether bcmath extension is already installed or not.
3. Run the command ‘apt-get install php-bcmath’ if bcmath extension is not installed
4. Run the command ‘php -m | grep bcmath’ to make sure the extension is enabled.
5. Create a phpinfo page under your website, if you are still getting the same error.
The php configuration file used by your website might be different if bcmath extension is still not showing enabled in phpinfo file.
Steps to install bcmath extension on Centos or Redhat Server
1. Log into your Linux server as ‘root’ user
2. Run the command ‘rpm -qa | grep -i bcmath’ to check whether bcmath extension is already installed.
3. Run the command ‘yum install php-bcmath’ to install bcmath extension on the server.
4. To verify whether the extension is enabled, you must run the command ‘php -m | grep bcmath’
5. Create a phpinfo file to verify bcmath extension is enabled.
Your site might be using a different php configuration file (php version other than default php version) if you are still getting the same error.
Steps to Install bcmath extension on Alpine Linux Server
1. Log into your Alpine Linux server as ‘root’ user
2. Run the command ‘apk install php7-bcmath’
3. Execute the command ‘php -m | grep bcmath’ to make sure the extension is enabled.
4. Create php info page to make sure the extension is enabled.