I am upgrading Drupal 7 to Drupal 9 and trying to copy over my CiviCRM database.

My Drupal 9 install is fresh. I used the instructions at https://docs.civicrm.org/installation/en/latest/drupal8/ to download CiviCRM with Composer.

I have upgraded the existing CiviCRM settings file to work with Drupal 9.

The problem is that I am getting the following error when trying to load Drupal."Warning: require_once(CRM/Core/ClassLoader.php): failed to open stream: No such file or directory in require_once() (line 516 of /home/user/public_html/web/sites/default/civicrm."

As expected Drupal will not load at all.

I have checked all my paths and that CiviCRM is in my vendor folder. /home/user/public_html/vendor/civicrm

Any help is greatly appreciated.

Thanks, Josh

1 Answer 1


Have you updated the civicrm.settings.php to include new location for $civicrm_root?

Add below entries in your civicrm.settings.php

$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/';                                                                                                     
$civicrm_paths['civicrm.root']['url'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/';
$civicrm_setting['domain']['userFrameworkResourceURL'] = CIVICRM_UF_BASEURL . '/libraries/civicrm/';
$civicrm_paths['cms.root']['path'] = '/home/path-to-drupal9/web';
  • That was the problem. However, I got it installed now and civicrm gets a 404 now that it is installed.
    – Josh
    Jun 8, 2021 at 6:42
  • Updated my answer Jun 8, 2021 at 6:51
  • 2
    Thank you! The issue with the 404 is that there was old advice to use Minimal Drupal install. However, the minimal install does not have the path module so /civicrm is not a valid path.
    – Josh
    Jun 8, 2021 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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