Call to undefined function simplexml_load_file()

≯℡__Kan透↙ 提交于 2019-12-05 09:31:07

I had the same issue. I fixed it by installing php7.2-xml:

$ apt-get install php7.2-xml

After that, SimpleXML got listed by php -m:

$ php -m | grep -i simple
SimpleXML

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!