drupaldrupal-commerce

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).

Solution

  • 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()