[SOLVED] Commerce requires the bcmath PHP extension. Drupal 8

BCMath is a set of PHP functions that allow you to use Arbitrary-precision arithmetic. Am getting an error "Commerce requires the bcmath PHP extension." before a couple of months. To resolve this error we need to enable BCMath extension. following steps help you to resolve bcmath php extension error.
Verify PHP version.
Before going to the next step you need to check the PHP version. you can check PHP version with the following command. Before installing or enable BCMath you need to know PHP version.
Also Read - How to install PHP 7.2 on Centos 7
# php -v
Output:-
PHP 7.2.14 (built: Jan 8 2019 14:05:15) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.14, Copyright (c) 1999-2018, by Zend Technologies
Install BCMath For PHP 7.0
- For centos or fedora
# sudo yum install -y php7.0-bcmath
-For Ubuntu users
# sudo yum install -y php7.0-bcmath
Install BCMath For PHP 5.5
For Centos or Fedora
# sudo yum install -y php5.5-bcmath
For Ubuntu users
$ sudo apt-get install php5.5-bcmath
Restart Apache server
After the PHP BCMath installation, we need to restart Apache service. With the following command.
# sudo service httpd restart
Add new comment