1

I am trying to migrate a Drupal+CiviCRM from an old server to a new one.

I copied the files and database, updated civicrm.settings.php and settings.php, cleared the cache and made a drush up + drush updb, both ran fine.

As the new server uses PHP 7.0, I downloaded civicrm-4.7.31 drupal and l10n files to replace the version 4.4.19 that was used. However, I still have a white screen when going to the homepage.

In /var/log/nginx/error.log, I can find this error:

2018/04/30 17:54:16 [error] 20389#20389: *845 FastCGI sent in stderr:
"PHP message: PHP Fatal error:  Cannot redeclare civicrm_enable()
(previously declared in
<civicrm_root_path>/sites/all/modules/civicrm/drupal/civicrm.module:781)
in
<civicrm_root_path>/sites/all/modules/civicrm/drupal/civicrm.install
on line 40" while reading response header from upstream, client:
XXX.XXX.XXX.XXX, server: XXXX, request: "GET / HTTP/1.1", upstream:
"fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "XXXX"

Edit: I already saw this post but that didn't help me fix my issue. I have only one copy of CiviCRM under my module directory. I tried the "drush vset civicrm_class_loader ''" command and now I have a new error message:

"2018/05/03 10:36:07 [error] 7010#7010: *2972 FastCGI sent in stderr:
"PHP message: PHP Fatal error: require_once(): Failed opening required
'CRM/Core/ClassLoader.php'
(include_path='.:<civicrm_old_root_path>/sites/all/modules/civicrm:<civicrm_old_root_path>/sites/all/modules/civicrm/packages:.:/usr/share/php')
> in <civicrm_root_path>/sites/default/civicrm.settings.php on line 280"
> while reading response header from upstream [...]"

With being the root path on the previous server, so it must be cached somewhere, but I cannot find where. This error disappears after a drush cc.

2

As answered by @davejenx here ("Cannot redeclare class CRM_Core_ClassLoader" in backup site) this could be your issue.

It sounds as though there is either a cached path to ClassLoader.php somewhere or there are two copies of the CiviCRM code under your modules directories. Various scenarios and solutions are discussed in this forum post: svn installation says "Cannot redeclare class CRM_Core_ClassLoader" Please post back here rather than on the forum, though.

If you're sure that there aren't multiple copies of CiviCRM under /home/mydomain/www/backup/ then the most likely fix is to clear the Drupal variable civicrm_class_loader, e.g. using drush:

drush vset civicrm_class_loader ''

There's a good chance the fatal error will prevent the use of drush. In that case, you can delete the row from Drupal's variable table where name = 'civicrm_class_loader'. It's possible the variables are cached in addition -- you may need to clear Drupal's cache tables manually. (A targeted approach -- in Drupal 6, anyway -- is to delete the row from Drupal's cache table where cid = 'variables'.)

  • I already saw this post but that didn't help me fix my issue. I have only one copy of CiviCRM under my module directory. I tried the "drush vset civicrm_class_loader ''" command and now I have a new error message: – Ash_Crow May 3 '18 at 8:37
  • "2018/05/03 10:36:07 [error] 7010#7010: *2972 FastCGI sent in stderr: "PHP message: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.php' (include_path='.:<civicrm_old_root_path>/sites/all/modules/civicrm:<civicrm_old_root_path>/sites/all/modules/civicrm/packages:.:/usr/share/php') in <civicrm_root_path>/sites/default/civicrm.settings.php on line 280" while reading response header from upstream [...]" – Ash_Crow May 3 '18 at 8:40
  • With <civicrm_old_root_path> being the root path on the previous server, so it must be cached somewhere, but I cannot find where... (sorry for the answer in 3 comments, I hit the character limit) – Ash_Crow May 3 '18 at 8:42
  • Did you try this? 1) Comment following lines in civicrm.settings.php : require_once 'CRM/Core/ClassLoader.php'; CRM_Core_ClassLoader::singleton()->register(); 2) Take backup of variable table in database & delete the row with name = 'civicrm_class_loader'. 3) With this your civicrm page should get loaded. 4) Now clear civicrm caches or hit "your_site/civicrm/menu/rebuild?reset=1" url. 5) Uncomment the above lines. this answer: (civicrm.stackexchange.com/a/14840/5649) – Chamil Wijesooriya May 3 '18 at 22:35
  • I tried it and it didn't work, I still have the errors. – Ash_Crow May 4 '18 at 9:25
1

I tried an intermediary update with the 4.6.36 with PHP 5 and, while I still have some update errors (I will open separate tickets if I cannot find the solution by myself), I do no longer have this one.

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.