4

I'm getting the error message below from a Symfony 2.8 application running PHP 7.2.8 on an Amazon Linux 2 server.

Fatal error: Uncaught RuntimeException: Extension DOM is required. in /var/www/html/my-app/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:45

php-xml is installed. Other common/related libraries are installed too - php-mbstring, php-common.

In phpinfo, I cannot see the "DOM" section. Below is the screen shot of the installed php-related libraries (yum list installed | grep php*)

enter image description here

What am I missing here?

phpd
  • 551
  • 4
  • 10

3 Answers3

20

After 2 days of nit-picking it turned out restarting php-fpm resolves the issue, though I was restarting httpd all along.

sudo systemctl restart php-fpm
phpd
  • 551
  • 4
  • 10
0

Did you verify the extension is enabled in your php.ini? Did yyou happen to install the correct version of php-xml? I had a few issues while installing PHP 7.x and installing extensions. It installed 5.6 extensions instead of 7.x when no version is specified.

Try these commands

To list all modules:

php -m

And/or to list the detailed configuration:

php -i

Check the output for the php-xml extension and if it is loaded.

I read that maybephp-mbstring has to be installed too. But i am not too sure of this, altough i usually have it installed.

Fjarlaegur
  • 1,395
  • 1
  • 14
  • 33
  • Yes here's the output of "php -i" for xml: XML Support => active. XML Namespace Support => active. libxml2 Version => 2.9.1 – phpd Oct 16 '18 at 08:33
0

In CentOS (and RHEL, i suppose) PHP module (extension) dom is provided by

php74-php-xml

https://centos.pkgs.org/7/remi-x86_64/php74-php-xml-7.4.11-1.el7.remi.x86_64.rpm.html

php74-php-dom
php74-php-domxml
php74-php-simplexml
php74-php-xml   = 7.4.11-1.el7.remi
php74-php-xmlreader
php74-php-xmlwriter
php74-php-xsl
user7568519
  • 113
  • 5