Syam Mohan M P
Syam Mohan M P

Reputation: 1067

RuntimeException: The bcmath extension is required by NumberFormatter

I have installed drupal commerce module. I am getting the below error while viewing a product page.

RuntimeException: The bcmath extension is required by NumberFormatter. in CommerceGuys\Intl\Formatter\NumberFormatter->__construct() (line 113 of /home/web/docroot/vendor/commerceguys/intl/src/Formatter/NumberFormatter.php).

Upvotes: 1

Views: 2472

Answers (4)

Muhammad Saeed
Muhammad Saeed

Reputation: 1

for Almalinux

> sudo dnf -y install php-bcmath

don't forget restart server

> sudo service httpd restart`

Upvotes: 0

Ajay Gadhavana
Ajay Gadhavana

Reputation: 443

Based on your PHP version you have to install bcmath extension.

for 7.2

 sudo apt install php7.2-bcmath

for 7.4

 sudo apt install php7.2-bcmath

Once done with installation you have to restart apache server then only it will start.

sudo service apache2 restart

Upvotes: 0

Harsha Dananjaya
Harsha Dananjaya

Reputation: 1

Install php-bcmath with dependencies

yum install php-bcmath

Upvotes: 0

Alen Simonyan
Alen Simonyan

Reputation: 380

You have bcmath error and you need to install PHP bcmath extension.

sudo apt install php7.2-bcmath

You can check enabled extensions with php function. get_loaded_extensions()

Upvotes: 3

Related Questions