Bcmath and gmp PHP extensions

My Security & setup warnings page is saying bcmath and gmp aren’t enabled

Do I really need this? NC docs say it’s for “passwordless login”, but I don’t think I use that. I login normally with username and password.

If I run phpinfo, it says php was compiled with it.

bcmath is already enabled, but I see nowhere to enable gmp in my settings. I’m using a shared server.

No, as the notification (and also the documentation) already says, you only need it if you want to use Passwordless Login (WebAuthn).

Then you should be fine without it.

In theory, it could of course also be possible that there are some third-party apps from the App Store that require it as well, but this would have to be stated in the documentation of the respective app if this were the case.

Not an expert, but it looks like it’s provided as a shared extension, instead of a static extension, as Nextcloud probably expects it to be. Maybe it’s possible to load it by adding it to the php.ini in the Nextcloud folder, but I’m not sure…

2 Likes

thanks. would be nice to know how to enable dynamic extensions. Web search didn’t turn up anything. I tried adding extension=gmp.so to my php.ini but it didn’t work.

Most distros have a package for both the GMP php module[1] and the dependency the for the module: the GMP library[2] itself.

Sounds like maybe yours doesn’t have the GMP library installed (which the gmp PHP module needs in order to be activated). Or maybe that you just need to restart your web server after updating your php.ini?

The check in Nextcloud Server[3] merely confirms if the extensions are loaded (active), roughly similar to running the php -m command (assuming CLI and mod_php/fpm mode PHP configs roughly match in your environment).

Not sure about CloudLinux specifically (what it appears your host uses), but gmp is supposed to be supported[4]. Might be something to ask your hosting provider.

[1] PHP: Installation - Manual
[2] PHP: Requirements - Manual
[3] https://github.com/nextcloud/server/blob/f225bf97dd1fc7085b33faea32ec1b3806ea9863/apps/settings/lib/Controller/CheckSetupController.php#L501-L509
[4] CloudLinux OS components

2 Likes