我已经安装了drupal commerce模块。我在查看产品页面时收到以下错误。
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).
您遇到 bcmath 错误,需要安装 PHP bcmath 扩展。
sudo apt install php7.2-bcmath
您可以使用 php 函数检查启用的扩展。
get_loaded_extensions()
安装 php-bcmath 及其依赖项
yum 安装 php-bcmath
根据您的 PHP 版本,您必须安装 bcmath 扩展。
7.2
sudo apt install php7.2-bcmath
7.4
sudo apt install php7.2-bcmath
安装完成后,您必须重新启动 apache 服务器,然后它才会启动。
sudo service apache2 restart
对于 Almalinux
> sudo dnf -y install php-bcmath
不要忘记重启服务器
> sudo service httpd restart`