Missing BC Math or GMB extension

I am using Rocky Linux (RHEL) as my OS, PHP 7.2.24

I am getting this error message when going to Admistration > Websites > Tracking Code:

Missing BC Math or GMP extension.

I’ve looked online and found out that I need to install GMP extension, which I did it through SSH:
sudo yum install php-gmp

Then I added this entry in /etc/php.ini:
extension=php_gmp.so

then I restarted the server, but I am getting the same error above.
I tried without having it in the php.ini, and getting same error.

This is a Matomo domain that has just 1 x domain setup, and the Javascript Tracking Code is not yet live on the site, thus maybe that’s the issue?!

I’ve never had this issue before and would appreciate if anyone has any idea / suggestion what I can do to fix it.

Thank you!

Hi @metrprime
Can you have a look in the Matomo errors log file?

Hi @heurteph-ei

sure, this is what my last 10 lines of /home/domain.com/public_html/matomo-folder/tmp/logs/matomo.log file show:

ERROR API[2023-10-02 09:31:36 UTC] [23337] Uncaught exception in API: /home/domain.com/public_html/matomo-folder/plugins/LogViewer/Log/Reader/File.php(26): Specified path to log file does not exist: /home/domain.com/public_html/matomo-folder/tmp/logs/matomo.log [Query: ?date=2023-10-02&module=API&format=json&query=&limitPerPage=100&source=file&page=0&method=LogViewer.getLogEntries&segment=&idSite=1&period=day, CLI mode: 0]
ERROR API[2023-10-02 12:10:25 UTC] [26f0b] Uncaught exception in API: You can't access this resource as it requires view access for at least one website. /home/domain.com/public_html/matomo-folder/core/Access.php:756
ERROR API[2023-10-02 12:15:26 UTC] [763d0] Uncaught exception in API: You can't access this resource as it requires view access for at least one website. /home/domain.com/public_html/matomo-folder/core/Access.php:756
ERROR API[2023-10-02 12:20:27 UTC] [46fda] Uncaught exception in API: You can't access this resource as it requires view access for at least one website. /home/domain.com/public_html/matomo-folder/core/Access.php:756
ERROR API[2023-10-02 12:25:28 UTC] [da5a4] Uncaught exception in API: You can't access this resource as it requires view access for at least one website. /home/domain.com/public_html/matomo-folder/core/Access.php:756
ERROR API[2023-10-12 12:56:04 UTC] [54a2a] Uncaught exception in API: /home/domain.com/public_html/matomo-folder/plugins/ProtectTrackID/vendor/hashids/hashids/src/Hashids.php(408): Missing BC Math or GMP extension. [Query: ?date=2023-10-02&module=API&format=json&method=SitesManager.getJavascriptTag&idSite=1&segment=&period=day, CLI mode: 0]
ERROR API[2023-10-12 12:56:06 UTC] [0485c] Uncaught exception in API: /home/domain.com/public_html/matomo-folder/plugins/ProtectTrackID/vendor/hashids/hashids/src/Hashids.php(408): Missing BC Math or GMP extension. [Query: ?date=2023-10-02&module=API&format=json&method=SitesManager.getImageTrackingCode&idSite=1&segment=&period=day, CLI mode: 0]
ERROR API[2023-10-12 12:57:12 UTC] [a929e] Uncaught exception in API: /home/domain.com/public_html/matomo-folder/plugins/ProtectTrackID/vendor/hashids/hashids/src/Hashids.php(408): Missing BC Math or GMP extension. [Query: ?date=2023-10-02&module=API&format=json&method=SitesManager.getImageTrackingCode&idSite=1&segment=&period=day, CLI mode: 0]
ERROR API[2023-10-12 12:57:14 UTC] [e5f8d] Uncaught exception in API: /home/domain.com/public_html/matomo-folder/plugins/ProtectTrackID/vendor/hashids/hashids/src/Hashids.php(408): Missing BC Math or GMP extension. [Query: ?date=2023-10-02&module=API&format=json&method=SitesManager.getJavascriptTag&idSite=1&segment=&period=day, CLI mode: 0]
ERROR API[2023-10-12 13:04:45 UTC] [31a0a] Uncaught exception in API: /home/domain.com/public_html/matomo-folder/plugins/ProtectTrackID/vendor/hashids/hashids/src/Hashids.php(408): Missing BC Math or GMP extension. [Query: ?date=2023-10-02&module=API&format=json&method=SitesManager.getJavascriptTag&idSite=1&segment=&period=day, CLI mode: 0]

I’ve installed the ProtectTrackID plugin https://plugins.matomo.org/ProtectTrackID and wanted to add the JS code on the first website, but seems that I can’t see the full Javascript Tracking Code thus I am now stuck:

  • I have no live website setup to track on this Matomo domain
  • and I have ProtectTrackID enabled and not able to copy the Javascript Code:

I am wondering maybe that’s the reason why, because there’s no live website tracked on Matomo?!

Thank you so much @heurteph-ei !

PS: I’ve upgraded to PHP 8.0.27 , not sure if it matters.
The issue was there even with PHP 7.4

@heurteph-ei problem sorted, the issue was that I had the wrong PHP version active.
I’ve changed it and installed the required PHP extensions for that PHP version.
Problem fixed : )

1 Like