I have installed php7 on Ubuntu 16.04 and I have installed Symfony also, but when I try to run server from my command line it shows this 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 /home/kanat/Documents/deneme/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php:52
Stack trace:
#0 /home/kanat/Documents/deneme/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(284): Symfony\Component\Config\Util\XmlUtils::loadFile('/home/kanat/Doc...', Array)
#1 /home/kanat/Documents/deneme/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php(41): Symfony\Component\DependencyInjection\Loader\XmlFileLoader->parseFileToDOM('/home/kanat/Doc...')
#2 /home/kanat/Documents/deneme/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php(57): Symfony\Component\DependencyInjection\Loader\XmlFileLoader->load('web.xml')
#3 /home/kanat/Documents/deneme/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection in /home/kanat/Documents/deneme/vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php on line 52 When I run the command php bin/console server:run it throws the above error.
1 Answer
To fix this problem I installed the following packages:
apt install libapache2-mod-php7.1 php7.1 php7.1-cli php7.1-json php7.1-opcache php7.1-readline php7.1-intl php7.1-xml