I'm not quite sure if this is a drush or a civicrm problem, sorry if this is the wrong forum.

I did an upgrade yesterday evening from version 4.6.4 to version 4.6.8. Drush version is 5.9. Today I tried to clear the cache using drush cc all, but I get an "unrecoverable error" message saying that:

PHP Fatal error:  Call to undefined method Composer\Autoload\ClassLoader::setPsr4() in /<myciviinstall>/civicrm/civicrm-4.6.8/civicrm/vendor/composer/autoload_real.php on line 37
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined method Composer\Autoload\ClassLoader::setPsr4() in /<myciviinstall>/civicrm/civicrm-4.6.8/civicrm/vendor/composer/autoload_real.php, line 37

This also happens for the drush cc civicrm command, and for the civicrm cron job:

30 * * * * /<hiddenpath>/bin/drush/drush -u 1 -r /<mysite>/public_html -l mysite.com civicrm-api job.execute auth=0 -y > /<hiddenpath>/cron/cronlogs/civi_error_drush_`date +\%F_\%T`.log /dev/null`

I should point out that the reason for the somewhat strange path in the PHP Fatal error message, is that I'm running civicrm (on Drupal 7) via softlinks to keep old versions present but "out of the way" so to speak. This to be able to (more) quickly swap back to older versions. This approach has worked well for me in the past, and I didn't have this drush problem yesterday evening before the upgrade.

Googling, I find clues that this may indicate that the version of the composer autoloader is out of date, but I'm not sufficiently familiar with composer to be able to tell for sure (is composer a drush thing only?).

Anyone got an idea?

  • hi vandalf - am hitting same error after an upgrade to 4.6.8 attempt (but perhaps unlike yours, i got the error after updating the codebase, so i didn't get to do the upgrade - did you find a solution
    – petednz - fuzion
    Sep 14, 2015 at 3:46
  • 1
    HI pete and Vandalf. Try turning off the Currency Module. It is using Composer as well.
    – Tommy B
    Sep 14, 2015 at 18:58
  • petednz-fuzion: I'm still working on solving this. TommyB: Thanks for the tip, but I haven't got the Currency module installed.
    – Vandalf
    Sep 15, 2015 at 7:43
  • Tommy B - you hit the nail on the head for us, shame i didn't spot your comment earlier.
    – petednz - fuzion
    Sep 16, 2015 at 2:41
  • Did anyone succeed in getting Civi 4.6.8 to coexist peacefully with the Currency module?
    – davejenx
    Sep 25, 2015 at 11:33

1 Answer 1


This error can occur when there is a clash with a Composer autoloader for another module, e.g. the Currency module.

A README has been added to currency 7.x-2.5 re this error, advising: 'try manually updating Currency's Composer dependencies by running the command "composer update" in Currency's root directory.' This worked for me. Vandalf isn't using Currency but maybe a similar issue with another module? Try searching for files called composer.json under your modules directory.

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.