Fatal error: Uncaught Error: Call to undefined function bcadd()
Asked Answered
C

2

14

After installed "eduTrac SIS" and accessing "dashboard" got this error

Ubuntu 16.4, PHP 7.0(php7.0-fpm), Apache2, Nginx,

URL gives error 500 and nginx/error.log displays,

FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function PHPBenchmark\bcadd() in /var/www/html/eduTrac-SIS/app/src/vendor/phpbenchmark/phpbenchmark/lib/PHPBenchmark/Utils.php:18

Conchiferous answered 29/6, 2018 at 4:14 Comment(0)
C
42

PHP does not recognize "bcadd()" gives the error. "bcadd()" function is included in "bcmath" PHP extention.

Just installing the relevant bcmath extension would solved the issue.

sudo apt-get install php7.0-bcmath

Please note, you should find the correct version of bcmath extension according to your PHP version. And restart apache

sudo service apache2 restart
Conchiferous answered 29/6, 2018 at 4:22 Comment(0)
V
6

For PHP 7.4- bcmath, install with apt or yum as below:

sudo apt install php7.4-bcmath

or

sudo yum install php7.4-bcmath
Valentia answered 20/10, 2020 at 18:6 Comment(2)
It is important to restart the apache2 service so it recognizes it. Like in the @Isanka Wijerathne answerPinnace
Package 'php7.4-bcmath' has no installation candidateTipcat

© 2022 - 2024 — McMap. All rights reserved.