magento2经常会遇到的权限问题

alex@alex:/var/www/html/magento2.2$ php bin/magento module:enable Yang_HelloWorld
The file "/var/www/html/magento2.2/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Proxy.php" cannot be deleted Warning!unlink(/var/www/html/magento2.2/generated/code/Magento/Theme/Model/ResourceModel/Theme/Collection/Proxy.php): Permission denied
alex@alex:/var/www/html/magento2.2$ sudo chown -R www-data:www-data /var/www/html/magento2.2
alex@alex:/var/www/html/magento2.2$ sudo chmod -R 777 /var/www/html/magento2.2
alex@alex:/var/www/html/magento2.2$ sudo chmod -R 777 var/ pub/ alex@alex:/var/www/html/magento2.2$ php bin/magento module:enable Yang_HelloWorld
The following modules have been enabled:

  • Yang_HelloWorld

To make sure that the enabled modules are properly registered, run 'setup:upgrade'.
Cache cleared successfully.
Generated classes cleared successfully. Please run the 'setup:di:compile' command to generate classes.
Info: Some modules might require static view files to be cleared. To do this, run 'module:enable' with the --clear-static-content option to clear them.

阅读 1.8k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题