0

I had a problem with my Ubuntu so I needed to install back everything. Nearly all is done but when I start a new project with Symfony on PhpStorm, and when I do a composer install or composer update in the terminal I have an error that I don't know how to treat.

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception



[RuntimeException]                                              
  An error occurred when executing the "'cache:clear --no-warmup'" command:



    PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "DOMDocument" from the global namespace.                                                      
  Did you forget a "use" statement? in /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:52                                                                          
  Stack trace:                                                                                                                                                                                               
  #0 /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(284): Symfony\Component\Config\Util\XmlUtils::loadFile('/var/www/html/E...', Array)       
  #1 /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(41): Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseFileToDOM('/var/ww  
  w/html/E...')                                                                                                                                                                                              
  #2 /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php(57): Symfony\Component\DependencyInjection\Loader\XmlFileLoader->load('web.xm  
  l')                                                                                                                                                                                                        
  #3 /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php in /var/www/html/Eval2/vendor/symfony/symfony/src/Symfony/Component/  
  Config/Util/XmlUtils.php on line 52  

I tried installing composer following this link but I don't recall using such practice.

So I cannot move forward with my project because I can't get past composer... if anyone knows why and could give me a step-by-step approach that would be truly appreciated.

Thank you

1 Answer 1

1

PHP's DOMDocument library is not installed. You need to install it. Try -

sudo apt-get install php-dom
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the answer. But when I do the command it says "Impossible to find php7-dom package"
What version of PHP are you using? And What version of Ubuntu?
PHP 7.0.13-0 ----- Ubuntu 0.16.04.1
Its working! I just did your command line without the "7" ! Thank you! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.