1. Home
  2. Linux
  3. Call to undefined function simplexml_load_file() – PHP Error [Solved]
  1. Home
  2. Programming Tools
  3. Call to undefined function simplexml_load_file() – PHP Error [Solved]

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
Updated on September 1, 2017

Was this article helpful?

Related Articles

Add A Comment