Skip to Content

ERROR - --> Severity: error --> Exception: Call to undefined function utf8_encode() /var/www/ezlogin/application/libraries/Yubico/Yubico.php 397

Fixing PHP Error: Call to undefined function utf8_encode()


Overview: This article describes how to resolve the PHP error "Call to undefined function utf8_encode()" by installing the php-xml extension on Ubuntu/Debian and Centos/Fedora/Red Hat servers.


 If you encounter the PHP error "Call to undefined function utf8_encode()" in your application, follow these steps to resolve it:

When encountering the error "Call to undefined function utf8_encode()", it typically means that the PHP function utf8_encode() is not available because the php-xml extension is not installed or enabled.

Open your terminal and run the following commands. 

- Ubuntu/Debian:

root@jumpserver:~# apt-get update && apt-get install php-xml

  • After installing the php-xml extension, restart Apache to apply the changes.

root@jumpserver:~# service apache2 restart

- CentOS/RedHat/Fedora:

root@jumpserver:~#yum install php-xml

  • After installing the php-xml extension, restart Apache to apply the changes.

root@jumpserver:~# service httpd restart


Related Articles:

Class DOMDocument not found.