Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined function simplexml_load_file()

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()"

like image 600
Sneha Maheshwari Avatar asked Mar 23 '18 10:03

Sneha Maheshwari


Video Answer


1 Answers

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
like image 200
Diego Pino Avatar answered Oct 04 '22 03:10

Diego Pino