I have php 7.0 running on my ubuntu server.
php -m command says:
[PHP Modules] calendar Core ctype curl date dom exif fileinfo filter ftp gd gettext hash iconv intl json libxml mbstring mcrypt mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql Phar posix readline Reflection session shmop SimpleXML sockets SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl Zend OPcache zip zlib
But still when I run my website, its log says "PHP Fatal error: Call to undefined function simplexml_load_file[]"
IMSoP
81.5k10 gold badges105 silver badges154 bronze badges
asked Mar 23, 2018 at 10:10
3
I had the same issue. I fixed it by installing php7.2-xml
:
$ sudo apt-get install php7.2-xml
$ sudo systemctl reload apache2
After that, SimpleXML got listed by php -m
:
$ php -m | grep -i simple
SimpleXML
answered Mar 21, 2019 at 13:17
5
I'm using ubuntu 18.04. When I checked for SimpleXML in module list, it was stated same like yours.
Then I check my phpinfo[] which says it was pulling from different php version and not the same with php cli.
To check php cli version, I run php -v
To check for phpinfo[], I put the function at the top of index.php of my script.
After confirming that my phpcli version is different than whats in phpinfo,
I simply run this 2 command
sudo a2dismod php7.0
sudo a2enmod php7.3
Then restart my apache
sudo systemctl restart apache2
After that, I test again my phpinfo[]
Now it is working.
answered Jul 14, 2019 at 8:09
Last Updated: November 9, 2020 | Reading Time: < 1 minutes
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.
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 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!
Ramya Santhosh
is a Web Designer and content creator. A freelance writer on latest trends in technology, gadget reviews, How to's and many more.