Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

883
Visualizações
Symfony 2.8 project using PHP7 : Extension DOM is required

I'm trying to upgrade from php 5 to 7 on a server hosting a symfony project. Actually the update from php 5 to 7 worked ;

php --version
PHP 7.2.29 (cli) (built: Mar 17 2020 11:58:47) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.29, Copyright (c) 1999-2018, by Zend Technologies

but now on my server only "public" pages worked, I mean when I go a page that needs the ORM it returns a 500 internal error. The log server file gives me this output :

[2020-03-20 14:38:49] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Validator\Exception\MappingException: "Extension DOM is required." at /var/www/myProject/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php line 179 {"exception":"[object] (Symfony\\Component\\Validator\\Exception\\MappingException(code: 0): Extension DOM is required. at /var/www/myProject/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php:179, RuntimeException(code: 0): Extension DOM is required. at /var/www/myProject/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:45)"} []
[2020-03-20 14:38:50] security.INFO: No expression found; abstaining from voting. [] []
[2020-03-20 14:38:50] security.INFO: No expression found; abstaining from voting. [] []

So I googled the error and thus I did that :

sudo yum install php72-php-mbstring php72-php-xml php72-php-xmlrpc

Then :

php -d memory_limit=-1 composer.phar update --no-cache
php -d memory_limit=-1  app/console cache:clear --env=prod
sudo systemctl restart httpd.service

And I still got this error...

EDIT : The cli version is PHP 7.2.29 which uses /etc/opt/remi/php72/php.ini file and the server PHP (showed by phpinfo(); function ) show PHP version 7.2.28 which uses /etc/php.ini file. I think I have to investigate with some apache config.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

You should check that extension is actually loaded. Do keep in mind that PHP CLI and PHP used by your webserver are two different beasts and may very well have different configuration files. Create a simple .php page in your project with

<?php phpinfo();

...navigate to it in your browser and see what extensions are actually loaded.

Follow instructions from your distribution to activate missing ones.

over 4 years ago · Santiago Trujillo Relatório

0

So actually the solution was :

1 re-link my package version with the 'good' version of PHP used by my server (uninstall and re install php 7.2)

and 2 type sudo yum install php-sql

That's strange but that solved my problem.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda