简体   繁体   中英

php bin/console symfony commands give a fatal error

I installed a symfony 3 project but cant run any php bin/console commands. When I try, I get the following error:

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 project_folder/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:52

Any idea how to fix this?

After hours of looking for solutions I checked the php packages that I had installed and realized that php-xml was not there.

sudo apt install php-xml

Now it works :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM