How to Fix ‘Call to undefined function simplexml_load_file’

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

Last Updated: November 9, 2020 | Reading Time: < 1 minute

I was in the middle of installing a plugin, then this error happened:

Fatal error: Call to undefined function simplexml_load_file

Seems like a PHP package called php-xml is missing in your installation. Here’s how to fix:

Login to your server using terminal, then upgrade all the package:

sudo apt-get update

then,

sudo apt-get upgrade

Now, install php-xml package:

sudo apt-get install php7.4-xml

That’s it and now you can refresh the page affected and the error will be gone.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.