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, it typically means that the PHP function utf8_encode() is not available because the php-xml extension is not installed or enabled. Follow below steps to resolve it:

Step 1: Open your terminal and run the following commands. 

  • Ubuntu/Debian:

:~# apt-get update && apt-get install php-xml

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

:~# service apache2 restart

  • CentOS/RedHat/Fedora:

:~# yum install php-xml

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

:~# service httpd restart


Related Articles

Class DOMDocument not found.