无效的路径别名:Yii2中的@ mdm / admin / messages?

时间:2019-02-14 09:51:49

标签: yii2 yii2-advanced-app

这是我的common\config\main.php文件,其中添加了两个模块。

'modules'    => [
    'admin' => [
        'class'  => 'mdm\admin\Module',
        'layout' => '//rbac/main-rbac',

    ],
    'audit' => [
        'class'       => 'bedezign\yii2\audit\Audit',
        'layout'      => '//audit/main-audit',
        'accessUsers' => [1, 2], //static id to test
    ],

这在我的本地wamp服务器上工作正常,但是在通过docker安装后,它们都在我的Ubuntu服务器上引发了错误。

以下是错误:

  

无效的路径别名:@ bedezign / yii2 / audit / web / assets,单击   审核模块
  无效的路径别名:@ mdm / admin / messages点击   rbac模块

这是我的供应商/yiisoft/extension.php

<?php

$vendorDir = dirname(__DIR__);

return array (
  'yiisoft/yii2-swiftmailer' => 
  array (
    'name' => 'yiisoft/yii2-swiftmailer',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii/swiftmailer' => $vendorDir . '/yiisoft/yii2-swiftmailer/src',
    ),
  ),
  '2amigos/yii2-chartjs-widget' => 
  array (
    'name' => '2amigos/yii2-chartjs-widget',
    'version' => '2.1.2.0',
    'alias' => 
    array (
      '@dosamigos/chartjs' => $vendorDir . '/2amigos/yii2-chartjs-widget/src',
    ),
  ),
  'bedezign/yii2-audit' => 
  array (
    'name' => 'bedezign/yii2-audit',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@bedezign/yii2/audit' => $vendorDir . '/bedezign/yii2-audit/src',
    ),
    'bootstrap' => 'bedezign\\yii2\\audit\\Bootstrap',
  ),
  'kartik-v/yii2-krajee-base' => 
  array (
    'name' => 'kartik-v/yii2-krajee-base',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@kartik/base' => $vendorDir . '/kartik-v/yii2-krajee-base/src',
    ),
  ),
  'kartik-v/yii2-widget-select2' => 
  array (
    'name' => 'kartik-v/yii2-widget-select2',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@kartik/select2' => $vendorDir . '/kartik-v/yii2-widget-select2/src',
    ),
  ),
  'yii2mod/yii2-enum' => 
  array (
    'name' => 'yii2mod/yii2-enum',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii2mod/enum' => $vendorDir . '/yii2mod/yii2-enum',
    ),
  ),
  'yii2mod/yii2-editable' => 
  array (
    'name' => 'yii2mod/yii2-editable',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii2mod/editable' => $vendorDir . '/yii2mod/yii2-editable',
    ),
  ),
  'yii2mod/yii2-moderation' => 
  array (
    'name' => 'yii2mod/yii2-moderation',
    'version' => '1.2.0.0',
    'alias' => 
    array (
      '@yii2mod/moderation' => $vendorDir . '/yii2mod/yii2-moderation',
    ),
  ),
  'yii2mod/yii2-behaviors' => 
  array (
    'name' => 'yii2mod/yii2-behaviors',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii2mod/behaviors' => $vendorDir . '/yii2mod/yii2-behaviors',
    ),
  ),
  'paulzi/yii2-sortable' => 
  array (
    'name' => 'paulzi/yii2-sortable',
    'version' => '1.0.2.0',
    'alias' => 
    array (
      '@paulzi/sortable' => $vendorDir . '/paulzi/yii2-sortable',
    ),
  ),
  'paulzi/yii2-adjacency-list' => 
  array (
    'name' => 'paulzi/yii2-adjacency-list',
    'version' => '2.2.0.0',
    'alias' => 
    array (
      '@paulzi/adjacencyList' => $vendorDir . '/paulzi/yii2-adjacency-list',
    ),
  ),
  'asofter/yii2-imperavi-redactor' => 
  array (
    'name' => 'asofter/yii2-imperavi-redactor',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii/imperavi' => $vendorDir . '/asofter/yii2-imperavi-redactor/yii/imperavi',
    ),
  ),
  'yii2mod/yii2-comments' => 
  array (
    'name' => 'yii2mod/yii2-comments',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii2mod/comments' => $vendorDir . '/yii2mod/yii2-comments',
    ),
  ),
  'mdmsoft/yii2-admin' => 
  array (
    'name' => 'mdmsoft/yii2-admin',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@mdm/admin' => $vendorDir . '/mdmsoft/yii2-admin',
    ),
  ),
  'linslin/yii2-curl' => 
  array (
    'name' => 'linslin/yii2-curl',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@linslin/yii2/curl' => $vendorDir . '/linslin/yii2-curl',
    ),
  ),
  'yiisoft/yii2-faker' => 
  array (
    'name' => 'yiisoft/yii2-faker',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii/faker' => $vendorDir . '/yiisoft/yii2-faker/src',
    ),
  ),
  'darkdrim/yii2-simplehtmldom' => 
  array (
    'name' => 'darkdrim/yii2-simplehtmldom',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@darkdrim/simplehtmldom' => $vendorDir . '/darkdrim/yii2-simplehtmldom',
    ),
  ),
  'insolita/yii2-migration-generator' => 
  array (
    'name' => 'insolita/yii2-migration-generator',
    'version' => '3.1.0.0',
    'alias' => 
    array (
      '@insolita/migrik' => $vendorDir . '/insolita/yii2-migration-generator',
    ),
    'bootstrap' => 'insolita\\migrik\\Bootstrap',
  ),
  'kartik-v/yii2-widget-fileinput' => 
  array (
    'name' => 'kartik-v/yii2-widget-fileinput',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@kartik/file' => $vendorDir . '/kartik-v/yii2-widget-fileinput/src',
    ),
  ),
  'kartik-v/yii2-widget-datepicker' => 
  array (
    'name' => 'kartik-v/yii2-widget-datepicker',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@kartik/date' => $vendorDir . '/kartik-v/yii2-widget-datepicker/src',
    ),
  ),
  'yiisoft/yii2-httpclient' => 
  array (
    'name' => 'yiisoft/yii2-httpclient',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii/httpclient' => $vendorDir . '/yiisoft/yii2-httpclient/src',
    ),
  ),
  'himiklab/yii2-recaptcha-widget' => 
  array (
    'name' => 'himiklab/yii2-recaptcha-widget',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@himiklab/yii2/recaptcha' => $vendorDir . '/himiklab/yii2-recaptcha-widget/src',
      '@himiklab/yii2/recaptcha/tests' => $vendorDir . '/himiklab/yii2-recaptcha-widget/tests',
    ),
  ),
  'yiisoft/yii2-imagine' => 
  array (
    'name' => 'yiisoft/yii2-imagine',
    'version' => '2.1.1.0',
    'alias' => 
    array (
      '@yii/imagine' => $vendorDir . '/yiisoft/yii2-imagine/src',
    ),
  ),
  'yii2tech/file-storage' => 
  array (
    'name' => 'yii2tech/file-storage',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii2tech/filestorage' => $vendorDir . '/yii2tech/file-storage/src',
    ),
  ),
  'yii2tech/ar-file' => 
  array (
    'name' => 'yii2tech/ar-file',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii2tech/ar/file' => $vendorDir . '/yii2tech/ar-file',
    ),
  ),
  'yii2mod/yii2-markdown' => 
  array (
    'name' => 'yii2mod/yii2-markdown',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii2mod/markdown' => $vendorDir . '/yii2mod/yii2-markdown',
    ),
  ),
  'rmrevin/yii2-fontawesome' => 
  array (
    'name' => 'rmrevin/yii2-fontawesome',
    'version' => '3.9999999.9999999.9999999-dev',
    'alias' => 
    array (
      '@rmrevin/yii/fontawesome' => $vendorDir . '/rmrevin/yii2-fontawesome',
    ),
  ),
  'yii2mod/yii2-cms' => 
  array (
    'name' => 'yii2mod/yii2-cms',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii2mod/cms' => $vendorDir . '/yii2mod/yii2-cms',
    ),
    'bootstrap' => 'yii2mod\\cms\\Bootstrap',
  ),
  'yiisoft/yii2-queue' => 
  array (
    'name' => 'yiisoft/yii2-queue',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii/queue' => $vendorDir . '/yiisoft/yii2-queue/src',
      '@yii/queue/amqp' => $vendorDir . '/yiisoft/yii2-queue/src/drivers/amqp',
      '@yii/queue/amqp_interop' => $vendorDir . '/yiisoft/yii2-queue/src/drivers/amqp_interop',
      '@yii/queue/beanstalk' => $vendorDir . '/yiisoft/yii2-queue/src/drivers/beanstalk',
      '@yii/queue/db' => $vendorDir . '/yiisoft/yii2-queue/src/drivers/db',
      '@yii/queue/file' => $vendorDir . '/yiisoft/yii2-queue/src/drivers/file',
      '@yii/queue/gearman' => $vendorDir . '/yiisoft/yii2-queue/src/drivers/gearman',
      '@yii/queue/redis' => $vendorDir . '/yiisoft/yii2-queue/src/drivers/redis',
      '@yii/queue/sync' => $vendorDir . '/yiisoft/yii2-queue/src/drivers/sync',
      '@yii/queue/sqs' => $vendorDir . '/yiisoft/yii2-queue/src/drivers/sqs',
    ),
  ),
  'yiisoft/yii2-bootstrap' => 
  array (
    'name' => 'yiisoft/yii2-bootstrap',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii/bootstrap' => $vendorDir . '/yiisoft/yii2-bootstrap/src',
    ),
  ),
  'yiisoft/yii2-redis' => 
  array (
    'name' => 'yiisoft/yii2-redis',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii/redis' => $vendorDir . '/yiisoft/yii2-redis/src',
    ),
  ),
  'yiisoft/yii2-debug' => 
  array (
    'name' => 'yiisoft/yii2-debug',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii/debug' => $vendorDir . '/yiisoft/yii2-debug/src',
    ),
  ),
  'yiisoft/yii2-gii' => 
  array (
    'name' => 'yiisoft/yii2-gii',
    'version' => '9999999-dev',
    'alias' => 
    array (
      '@yii/gii' => $vendorDir . '/yiisoft/yii2-gii/src',
    ),
  ),
  'froala/yii2-froala-editor' => 
  array (
    'name' => 'froala/yii2-froala-editor',
    'version' => '2.9.3.0',
    'alias' => 
    array (
      '@froala/froalaeditor' => $vendorDir . '/froala/yii2-froala-editor/src',
    ),
  ),
);

这是我的htacces文件

Options -Indexes

<IfModule mod_rewrite.c> 
  RewriteEngine on

  RewriteCond %{REQUEST_URI} !^public
  RewriteRule ^(.*)$ backend/web/$1 [L] 
</IfModule>

# Deny accessing below extensions
<Files ~ "(.json|.lock|.git)">
Order allow,deny
Allow from all
</Files>

# Deny accessing dot files
RewriteRule (^\.|/\.) - [F]

2 个答案:

答案 0 :(得分:0)

  

基本上,作曲家更新未生成extension.php   正确地。删除了   服务器上的vendor文件夹,然后再次更新作曲家。

答案 1 :(得分:-1)

尝试使用别名

@bedezign/yii2-audit/web/assets
@mdmsoft/yii2-admin/messages

文档说https://www.yiiframework.com/doc/guide/2.0/en/concept-aliases#extension-aliases别名是作曲家软件包的名称。