Import Error on Module x509

Hello everyone, i am trying to install the module “x509”.
but i get the following error when executing the command

]# icingacli x509 import --file /etc/ssl/certs/ca-certificates.crt --debug -trace
Importing certificate: /C=BR/O=ICP-Brasil/OU=Instituto Nacional de Tecnologia da Informacao - ITI/L=Brasilia/ST=DF/CN=Autoridade Certificadora Raiz Brasileira
PHP Fatal error:  Uncaught Error: Call to undefined function Icinga\Module\X509\gmp_export() in /usr/share/icingaweb2/modules/x509/library/X509/CertificateUtils.php:243
Stack trace:
#0 /usr/share/icingaweb2/modules/x509/application/clicommands/ImportCommand.php(43): Icinga\Module\X509\CertificateUtils::findOrInsertCert(Object(ipl\Sql\Connection), Resource id #123)
#1 [internal function]: Icinga\Module\X509\Clicommands\ImportCommand->Icinga\Module\X509\Clicommands\{closure}(Object(ipl\Sql\Connection))
#2 /usr/share/icinga-php/ipl/vendor/ipl/sql/src/Connection.php(539): call_user_func(Object(Closure), Object(ipl\Sql\Connection))
#3 /usr/share/icingaweb2/modules/x509/application/clicommands/ImportCommand.php(53): ipl\Sql\Connection->transaction(Object(Closure))
#4 /usr/share/php/Icinga/Cli/Loader.php(267): Icinga\Module\X509\Clicommands\ImportCommand->indexAction()
#5 /usr/share/php/Icinga/Application/Cli.php(164): Icinga\Cli\Loader->dispatch()
#6 /usr/share/php/Icinga/Application/Cli.php(154): Icinga\Application\Cli->dispatchOnc in /usr/share/icingaweb2/modules/x509/library/X509/CertificateUtils.php on line 243

Fatal error: Uncaught Error: Call to undefined function Icinga\Module\X509\gmp_export() in /usr/share/icingaweb2/modules/x509/library/X509/CertificateUtils.php:243
Stack trace:
#0 /usr/share/icingaweb2/modules/x509/application/clicommands/ImportCommand.php(43): Icinga\Module\X509\CertificateUtils::findOrInsertCert(Object(ipl\Sql\Connection), Resource id #123)
#1 [internal function]: Icinga\Module\X509\Clicommands\ImportCommand->Icinga\Module\X509\Clicommands\{closure}(Object(ipl\Sql\Connection))
#2 /usr/share/icinga-php/ipl/vendor/ipl/sql/src/Connection.php(539): call_user_func(Object(Closure), Object(ipl\Sql\Connection))
#3 /usr/share/icingaweb2/modules/x509/application/clicommands/ImportCommand.php(53): ipl\Sql\Connection->transaction(Object(Closure))
#4 /usr/share/php/Icinga/Cli/Loader.php(267): Icinga\Module\X509\Clicommands\ImportCommand->indexAction()
#5 /usr/share/php/Icinga/Application/Cli.php(164): Icinga\Cli\Loader->dispatch()
#6 /usr/share/php/Icinga/Application/Cli.php(154): Icinga\Application\Cli->dispatchOnc in /usr/share/icingaweb2/modules/x509/library/X509/CertificateUtils.php on line 243

Icinga Web 2 version: 2.9.6
Icinga 2 version: 2.13.2
PHP version: 7.4
OS: Centos 7

Modules:
incubator 0.6.0
ipl 0.5.0
reactbundle 0.9.0

Thanks in Advance :slight_smile:

Hi,

one of the requirements is the gmp php-extension. It seems you have not installed it or it’s not properly loaded by php.

Hi, thanks for the quick reply.

gmp php-extension is installed.

Just noticed you’re using centos7. Then also php-fpm plays a role. Have you installed gmp for the php-fpm interpreter or the system default one? You should install it for php-fpm. The package name should be rh-php73-php-gmp.

1 Like

that worked thank you very much :slight_smile: