Call to undefined function simplexml_load_file() – PHP Error [Solved]

While working on a migration of a Joomla powered website on to a new VPS with PHP version 7.0 and Apache 2.4, encountered the an error “Call to undefined function simplexml_load_file()“. Below is the complete error.

Error displaying the error page: Call to undefined function simplexml_load_file(): Call to undefined function simplexml_load_file()

In this tutorial, I’ll explain how to solve this issue.

Solution:

How to fix PHP error: call to undefined function

How to find out the PHP Modules installed?

Check if SimpleXML PHP module is installed using the below command:

#php -m
[PHP Modules]
calendar
Core
ctype
dat....

In my case, the module simpleXML wasn’t installed.

How to fix undefined function simplexml_load_file error?

Install simpleXML php module using the below command:

#apt-get install php7.0-simplexml

Now if you load the php modules, the simpleXML module will be listed in it.

#php -m
[PHP Modules]
calendar
Core
...
session
shmop
SimpleXML
sockets
SPL
....

You need to restart the Apache server

#/etc/init.d/apache2 restart

Now, Joomla should work!


Related Content
vps germany
Disclaimer: The content published in this article is the views of the author only. Techglimpse does not gurantee accuracy, completness or validity. If you believe the content on this post violates your copyright, please send us a mail for removal. Read more.