PHP Fatal error: Call to undefined function bcmod()

Updated on October 30, 2018

I recently purchased an examination software plugin called EduExpression for WordPress. However, I got the below error while setting up the plugin.

PHP Fatal error: Call to undefined function bcmod()
Environment

The version of EduExpression I have been setting up requires PHP 5.6. And it runs on Nginx Web server.

How to fix Call to undefined function bcmod

In this tutorial, I’ll explain how to fix Call to undefined function bcmod() error. According to the error, it’s clear that the plugin is dependent on the BCMATH support. Hence, installing bcmath for PHP should solve this error. Installing bcmath for PHP is quite simple, as you just need to install it using yum.

#yum install php-bcmath

This will install the bcmath extension corresponding to the version of PHP installed on your system.

If you need to install the bcmath extension to a specific version of PHP like 5.6, then follow the below command:

#yum install php56-php-bcmath

Once installed, restart corresponding php-fpm (If you are running php-fpm) as below:

#systemctl restart php-fpm

or specifically if you are running php56-php-fpm

#systemctl restart php56-php-fpm

And then restart the webserver

#systemctl restart nginx

Was this article helpful?

Related Articles

Leave a Comment