通过作曲家安装Drupal会产生内存错误

时间:2019-01-14 11:49:56

标签: composer-php drupal-8

我已经接管了一个现有的Drupal项目,已经将该项目的git存储库克隆到了开发服务器上,并运行composer install以安装所有项目依赖项。

当我尝试在浏览器中查看网站时,看到错误500,并且服务器上的apache错误日志显示以下错误;

[Mon Jan 14 11:38:41.246259 2019] [php7:error] [pid 1363] [client 80.229.235.74:52957] PHP Fatal error:  Allowed memory size of 2097152 bytes exhausted (tried to allocate 73728 bytes) in /var/www/vhosts/agilit-e/6bc72c45/vendor/composer/ClassLoader.php on line 444

我已经将服务器上的可用内存增加到3GB,并且我编辑了php.ini文件以将可用内存增加到2GB(通过phpinfo()确认),但是仍然看到此错误。 / p>

Composer是否有任何理由需要那么多内存?这是我的composer.json文件的副本,仅供参考。

{
  "name": "drupal-composer/drupal-project",
  "description": "Project template for Drupal 8 projects with composer",
  "type": "project",
  "license": "GPL-2.0+",
  "authors": [
    {
      "name": "",
      "role": ""
    }
  ],
  "repositories": [
    {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    },
    {
      "type": "package",
      "package": {
        "name": "harvesthq/chosen",
        "version": "1.6.1",
        "type": "drupal-library",
        "dist": {
          "url": "https://github.com/harvesthq/chosen/releases/download/v1.6.1/chosen_v1.6.1.zip",
          "type": "zip"
        },
        "require": {
          "composer/installers": "^1.2.0"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "dinbror/blazy",
        "version": "1.8.2",
        "type": "drupal-library",
        "dist": {
          "url": "https://github.com/dinbror/blazy/archive/1.8.2.zip",
          "type": "zip"
        },
        "require": {
          "composer/installers": "^1.2.0"
        }
      }
    },
    {
        "type": "vcs",
        "url": "https://gitlab.com/leed-collective/capita-cs-base-theme.git"
    },
    {
        "type": "vcs",
        "url": "https://gitlab.com/leed-collective/capita-cs-admin-theme.git"
    },
    {
        "type": "vcs",
        "url": "https://gitlab.com/leed-collective/capita-cs-base-modules.git"
    }
  ],
  "require": {
    "composer/installers": "^1.2",
    "cweagans/composer-patches": "^1.6",
    "dinbror/blazy": "^1.8",
    "drupal-composer/drupal-scaffold": "^2.2",
    "drupal/access_unpublished": "^1.0@alpha",
    "drupal/admin_toolbar": "^1.19",
    "drupal/allowed_formats": "^1.1",
    "drupal/autocomplete_deluxe": "^1.0",
    "drupal/better_exposed_filters": "^3.0",
    "drupal/blazy": "^1.0",
    "drupal/block_class": "^1.0",
    "drupal/block_content_permissions": "^1.0",
    "drupal/chosen": "^2.3",
    "drupal/config_filter": "^1.0",
    "drupal/config_ignore": "^2.1",
    "drupal/config_split": "^1.2",
    "drupal/console": "~1.0",
    "drupal/core": "~8.5.8",
    "drupal/ctools": "^3.0",
    "drupal/default_content": "^1.0@alpha",
    "drupal/devel": "^1.0",
    "drupal/diff": "^1.0",
    "drupal/draggableviews": "^1.0",
    "drupal/easy_breadcrumb": "^1.6",
    "drupal/entity_browser": "^1.0",
    "drupal/entity_reference_revisions": "^1.3",
    "drupal/eu_cookie_compliance": "^1.0",
    "drupal/field_group": "^3.0",
    "drupal/formblock": "^1.0",
    "drupal/google_analytics": "^2.1",
    "drupal/google_tag": "^1.0",
    "drupal/honeypot": "^1.23",
    "drupal/image_style_quality": "^1.3",
    "drupal/image_widget_crop": "^2.0",
    "drupal/inline_entity_form": "^1.0",
    "drupal/ip2country": "^1.8",
    "drupal/link_attributes": "^1.1",
    "drupal/linkit": "^5.0",
    "drupal/media_entity_document": "1.1",
    "drupal/media_entity_image": "1.2",
    "drupal/media_entity_video": "1.0-beta2",
    "drupal/menu_block": "^1.4",
    "drupal/menu_breadcrumb": "^1.3",
    "drupal/metatag": "^1.3",
    "drupal/migrate_plus": "^2.0",
    "drupal/migrate_tools": "^2.0",
    "drupal/paragraphs": "^1.1",
    "drupal/pathauto": "^1.0",
    "drupal/pathologic": "^1.0@alpha",
    "drupal/rabbit_hole": "^1.0",
    "drupal/recreate_block_content": "^2.0",
    "drupal/redirect": "^1.0",
    "drupal/restrict_ip": "^1.3",
    "drupal/search_exclude": "^1.1",
    "drupal/search_exclude_nid": "^1.2",
    "drupal/signature": "dev-1.x#048ad876778b2e1ad5a3baaabd2210e1e1be7a1e",
    "drupal/silent_contribute": "^1.1",
    "drupal/simple_sitemap": "^2.7",
    "drupal/smtp": "^1.0",
    "drupal/social_media_links": "^2.4",
    "drupal/styleguide": "^1.0",
    "drupal/taxonomy_access_fix": "^2.5",
    "drupal/token": "^1.0",
    "drupal/token_filter": "^1.0",
    "drupal/twig_tweak": "^1.8",
    "drupal/username_enumeration_prevention": "^1.0",
    "drupal/video_embed_field": "^1.5",
    "drupal/video_embed_wistia": "^1.0",
    "drupal/views_bulk_edit": "^1.0",
    "drupal/views_bulk_operations": "^1.0",
    "drupal/webform": "5.0-rc11",
    "drush/drush": "~8.0",
    "leed-collective/capita_base_theme": "master",
    "leed-collective/capita_admin_theme": "master",
    "leed-collective/capita-cs-base-modules": "master",
    "geerlingguy/drupal-vm": "4.7.0",
    "harvesthq/chosen": "^1.6",
    "oomphinc/composer-installers-extender": "^1.1",
    "webflo/drupal-finder": "^0.3.0",
    "webmozart/path-util": "^2.3"
  },
  "require-dev": {
    "behat/mink": "~1.7",
    "behat/mink-goutte-driver": "~1.2",
    "jcalderonzumba/gastonjs": "~1.0.2",
    "jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
    "mikey179/vfsstream": "~1.2",
    "phpunit/phpunit": ">=4.8.28 <5",
    "symfony/css-selector": "~2.8"
  },
  "conflict": {
    "drupal/drupal": "*"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "config": {
    "sort-packages": true
  },
  "scripts": {
      "drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
      "pre-install-cmd": [
          "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
      ],
      "pre-update-cmd": [
          "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
      ],
      "post-install-cmd": [
          "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
      ],
      "post-update-cmd": [
          "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
      ]
  },
  "extra": {
    "installer-types": [
        "capita-module",
        "capita-theme",
        "capita-profile"
    ],
    "installer-paths": {
        "web/core": [
            "type:drupal-core"
        ],
        "web/libraries/{$name}": [
            "type:drupal-library"
        ],
        "web/modules/contrib/{$name}": [
            "type:drupal-module"
        ],
        "web/modules/capita_base/{$name}": [
            "type:capita-module"
        ],
        "web/profiles/contrib/{$name}": [
            "type:drupal-profile"
        ],
        "web/profiles/capita_base/{$name}": [
            "type:capita-profile"
        ],
        "web/themes/contrib/{$name}": [
            "type:drupal-theme"
        ],
        "web/themes/capita_base/{$name}": [
            "type:capita-theme"
        ],
        "drush/contrib/{$name}": [
            "type:drupal-drush"
        ]
    },
    "patches": {
      "drupal/core": {
        "Fix issue of grouped filters using the array key id for the query rather than the term IDs": "https://www.drupal.org/files/issues/2049603-fixing-tid-in-exposed-group-filter-sql-query-in-views.patch"
      },
      "drupal/default_content": {
        "Allow exporting all taxonomy terms for a given vocab": "https://www.drupal.org/files/issues/default_content-export-all-items-2786479-12.patch",
        "Allow existing entities to be updated": "https://www.drupal.org/files/issues/2018-06-05/default_content-dont-reimport-existing-entities-2698425-102.patch",
        "Allow manually importing content again, not just on install": "https://www.drupal.org/files/issues/default_content-allow_manual_imports-2640734-72.patch"
      },
      "drupal/field_group": {
        "Tabs with invalid input are not focused": "https://www.drupal.org/files/issues/field-group-tab-focus-invalid-input.patch"
      },
      "drupal/linkit": {
        "Linkit for Link field": "https://www.drupal.org/files/issues/2018-03-25/2712951-59.patch"
      }
    }
  }
}

0 个答案:

没有答案