0

I keep having this problem of drupal redirecting to core/install.php as shown below:

enter image description here

I already set the max_allowed_packet to 64MB on AWS RDS. I am not sure what else I am missing. Please help

The error in the logs is:

Fatal error: Cannot redeclare _drupal_shutdown_function_handle_exception() (previously declared in /var/www/html/web/core/includes/bootstrap.inc:1066) in /var/www/html/vendor/drupal/core/includes/bootstrap.inc on line 1066

and the following is my composer.json

{
  "name": "xxx/yyy",
  "description": "zzz",
  "type": "project",
  "license": "GPL-2.0-or-later",
  "authors": [
    {
      "name": "QQQ EEE",
      "role": "Developer"
    }
  ],
  "repositories": [
    {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    }
  ],
  "require": {
    "php": ">=5.6",
    "aws/aws-sdk-php": "^3.108",
    "composer/installers": "^1.2",
    "cweagans/composer-patches": "^1.6.5",
    "drupal-composer/drupal-scaffold": "^2.5",
    "drupal/console": "^1.0.2",
    "drupal/core": "^8.7.0",
    "drupal/ldap": "^3.0@beta",
    "drupal/redis": "^1.1",
    "drupal/s3fs": "^3.0",
    "drush/drush": "^9.0.0",
    "predis/predis": "^1.1",
    "vlucas/phpdotenv": "^2.4",
    "webflo/drupal-finder": "^1.0.0",
    "webmozart/path-util": "^2.3",
    "zaporylie/composer-drupal-optimizations": "^1.0"
  },
  "require-dev": {
    "webflo/drupal-core-require-dev": "^8.7.0"
  },
  "conflict": {
    "drupal/drupal": "*"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "config": {
    "sort-packages": true
  },
  "autoload": {
    "classmap": [
      "scripts/composer/ScriptHandler.php"
    ],
    "files": ["load.environment.php"]
  },
  "scripts": {
    "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": {
    "composer-exit-on-patch-failure": true,
    "patchLevel": {
      "drupal/core": "-p2"
    },
    "installer-paths": {
      "web/core": ["type:drupal-core"],
      "web/libraries/{$name}": ["type:drupal-library"],
      "web/modules/contrib/{$name}": ["type:drupal-module"],
      "web/profiles/contrib/{$name}": ["type:drupal-profile"],
      "web/themes/contrib/{$name}": ["type:drupal-theme"],
      "drush/Commands/{$name}": ["type:drupal-drush"]
    },
    "drupal-scaffold": {
      "initial": {
        ".editorconfig": "../.editorconfig",
        ".gitattributes": "../.gitattributes"
      }
    }
  }
}
  • What is the error showing up in the logs? – Jaypan Aug 8 '19 at 1:45
  • CloudWatch keep showing "GET / HTTP/1.1" 302 571 "-" "ELB-HealthChecker/2.0". Let me try to deploy $config['system.logging']['error_level'] = 'verbose'; in settings.php – Moses Liao GZ Aug 8 '19 at 2:51
  • Ok it says Fatal error: Cannot redeclare _drupal_shutdown_function_handle_exception() (previously declared in /var/www/html/web/core/includes/bootstrap.inc:1066) in /var/www/html/vendor/drupal/core/includes/bootstrap.inc on line 1066 – Moses Liao GZ Aug 8 '19 at 3:09
2

You've got a problem with your installation. You have two copies of core, as can be seen from the two paths in the error message:

/var/www/html/web/core/includes/bootstrap.inc

/var/www/html/vendor/drupal/core/includes/bootstrap.inc

You should not have a copy of core in your vendor directory. That needs to be removed, though it may also break your site. Make sure to clear the registry drush cr or equivalent after removing that directory.

| improve this answer | |
  • How is it possibly happened in the first place? I use Composer to install – Moses Liao GZ Aug 8 '19 at 3:44
  • By default, composer will install to the vendor folder. The template for Drupal that most people use (github.com/drupal-composer/drupal-project) adds some code so that the library is installed to /web/core. Somehow you have ended up with both, indicating a problem in your composer.json, either now, or at some point in the past. – Jaypan Aug 8 '19 at 3:45
  • I just add in my composer.json. See if there are any issues with it – Moses Liao GZ Aug 8 '19 at 4:08
  • 1
    @MosesLiaoGZ – Try $ cd path/to/drupal-project && rm -rf vendor/ && rm composer.lock && composer install. Then clear Drupal cache, run updates and cron and flush cache again. Then check your .htaccess. – leymannx Aug 8 '19 at 8:03
  • yup that works. Thanks!. I upvoted the solution. – Moses Liao GZ Aug 9 '19 at 3:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.