Magento 2 – Cannot Run Commands in Terminal

clifile-permissionsmagento-2.1magento2

When try run command in terminal example
php bin setup:upgrade
show like these error messages. Not only that but also all commands

-[ReflectionException]
Class Magento\Config\Console\Command\ConfigSet\ProcessorFacadeFactory does
not exist.
– [ReflectionException]
Class Magento\Config\Console\Command\ConfigSet\ProcessorFacadeFactory does
not exist.
– [RuntimeException]
Can't create directory /var/www/html/robolk/generated/code/Magento/Config/Console/Command/ConfigSet/.
in [Magento\Config\Console\Command\ConfigSet\ProcessorFacadeFactory].

Why is Magento showing these errors?

Best Answer

You need to Set permission in Var like ...

Sudo chmod 0777 -R var/ generated/

If sudo not working then just ..

chmod 0777 -R var/ generated/
Related Topic