Call to undefined function simplexml_load_file()

后端 未结 2 1864
忘了有多久
忘了有多久 2021-02-19 13:21

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
ico         


        
2条回答
  •  忘掉有多难
    2021-02-19 13:42

    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.

提交回复
热议问题