【问题标题】:Yii2: AssetManager.php deleted automatic in Yii2 AdvancedYii2:AssetManager.php 在 Yii2 Advanced 中自动删除
【发布时间】:2019-12-30 07:35:01
【问题描述】:

我在Yii2高级框架中使用了Web云托管和我的项目,当我上传它时,在vendor/yiisoft/yii2/web/AssetManager.php中自动删除。 当我从托管处询问时,他们说您的文件有符号链接!

如何解决?

【问题讨论】:

  • 你应该在你的项目中运行 composer update 命令来恢复任何丢失的供应商文件。

标签: php yii2 yii2-advanced-app cloud-hosting


【解决方案1】:

您的 .gitignore 或 .gitexclude 中可能有“资产”。然后,部署将不包括任何被忽略的文件,例如 app/assets,但也不包括 AssetManager.php

【讨论】:

    【解决方案2】:

    根据http://www.yiiframework.com/doc-2.0/guide-structure-assets.html#asset-publishing 中的文档,您可能已将资产发布设置为使用符号链接。

    可以在config/main.php中设置配置

    return [
        // ...
        'components' => [
            'assetManager' => [
                'linkAssets' => true,
            ],
        ],
    ];
    

    【讨论】:

      猜你喜欢
      • 2015-03-31
      • 2015-11-10
      • 2015-08-06
      • 2016-06-04
      • 1970-01-01
      • 1970-01-01
      • 2018-12-30
      • 1970-01-01
      相关资源
      最近更新 更多