当我进行编译时,我在 magento 2.2.3 中创建了一个错误

When I make a compilation, I create an error in magento 2.2.3

每次我尝试进行编译时都会显示此错误,我不知道如何解决。

有什么想法吗?

php bin/magento setup:di:compile

编译开始。 区域配置聚合... 5/7 [====================>------] 71% 28 秒 252.0 MiB

[反射异常] Class Magento\Framework\Acl\CacheInterface 不存在

[反射异常] Class Magento\Framework\Acl\CacheInterface 不存在

请为 magento 根目录下的 generated 文件夹提供 777 权限 installation.Please 在编译前使用下面给出的命令:-

  • php bin/magento cache:flush
  • php bin/magento cache:clean
  • sudo rm -rf 生成/*
  • sudo chmod -R 777 生成/
  • php bin/magento setup:di:compile

此外,如果存在权限问题,那么您可以在命令前使用 sudo

好像是权限问题,请设置正确的文件权限

运行 下面的命令设置正确的文件权限:

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find var pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
chmod u+x bin/magento

对于本地开发,将 pub 和 var 设置为 775 或 777

class Magento\Framework\Acl\CacheInterface 当前不存在,因为 Magento 2.2,将其替换为 Magento\Framework\Acl\Data\CacheInterface