PHP 7 simpleXML fatal error

Benedikt Schmeitz picture Benedikt Schmeitz · Nov 12, 2016 · Viewed 7.3k times · Source

I'm not able to solve a problem with simplexml.

I just set up an ec2 instance on aws linux/ubuntu with apache2 server and trying to install shopware.

Problem:

Fatal error: Call to undefined function XXX\Recovery\Install\simplexml_load_file() in /var/www/XXX/recovery/install/src/Requirements.php on line 104

Searching for known issues. I came up with manually installed packages for php. After checking phpinfo and php -m i asume that following modules are installed:

[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
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 I'm not sure if their enabled. Do I need to enable simplexml manually in my php.ini file? How to do this correctly?

version info:

PHP 7.0.12-1+deb.sury.org~xenial+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.12-1+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies

Thanks for helping.

Answer

Benedikt Schmeitz picture Benedikt Schmeitz · Nov 13, 2016

Solution:

I updated the missing package

sudo apt-get install php7.0-xml

(I also installed some related xml librarys. There are plenty of posts on google related to this).

Afterwards this didn't solve my problem. The reason was I messed up my php installation. For any reason apache2 was configured with php5.6 so for me worked:

sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart

Hope this saves somebody some time, in future.