PHP 7.1 on Ubuntu with Attempted to load class "DOMDocument" from the global namespace

872 Views Asked by At

I am stuck with:

ClassNotFoundException in XmlUtils.php line 52: Attempted to load class "DOMDocument" from the global namespace. Did you forget a "use" statement? in XmlUtils.php (line 52)

I am running a Symfony LTS application 2.8 in a docker container with Apache/2.4.18 (Ubuntu) and PHP 7.1.9-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Sep 2 2017 05:56:43) ( NTS )

and tried:

  • clearing cache
  • installing php7.1-xml and restarting
  • installing php-xml and restarting
  • installing php7.1-dom and restarting
  • installing php7.1-intl and restarting
  • removing xdebug and restarting

Modules installed: php -m

PHP Modules
    calendar
    Core
    ctype
    curl
    date
    dom
    exif
    fileinfo
    filter
    ftp
    gd
    gettext
    hash
    iconv
    imap
    intl
    json
    libxml
    mbstring
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_myser
    wddx
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib

    [Zend Modules]
    Zend OPcache
0

There are 0 best solutions below