I am trying to reinstall the volunteers extension and am getting an error that isn't clear. Is this my version of PHP or missing PEAR packages that is causing the lack of clarity?

Use of undefined constant PEAR_ERROR_CALLBACK 
- assumed \'PEAR_ERROR_CALLBACK\'\";s:9:\"%function\";s:38:\"CRM_Core_TemporaryErrorScope::create()

CiviCRM 4.7.25 PHP 5.5.38

2 Answers 2


A look at the only code which references PEAR_ERROR_CALLBACK in CiviCRM core is telling - the file comment starts with This is an evil, evil workaround ....

So you've probably uncovered a legit unexpected bug or misbehaviour here. Something about the site setup or the volunteers extension seems to be upsetting things, but in a way that might not be experienced by the majority of sites.

Your PHP version is OK if not great, and your installed PEAR libraries should not interact with CiviCRM (which bundles its own copies of PEAR libs). So I don't think those should be your problem.

In your situation, I'd first check the Debugging and Error Handling settings (see civicrm/admin/setting/debug in your CiviCRM install) and make sure there aren't any unexpected "error callback" settings. Also check out what other extensions (especially debug related) are present in your install; try disabling those if present.

Next steps to debug would be to find backtraces in the CiviCRM debug log, and understand what code path is leading to this error.

More thoughts ... Assuming CRM_Core_TemporaryErrorScope::create() works the rest of the time, then we know PEAR_ERROR_CALLBACK is defined the rest of the time. This means that when you hit this error, you're hitting that method when PEAR hasn't been loaded at all.

The constant ought to be defined when PEAR is loaded during CiviCRM bootstrap; CiviCRM isn't going to get much done without PEAR, since it relies on that for essentials like DB access. This suggests CiviCRM has not been fully bootstrapped - we see similar issues also when the CMS is not bootstrapped, so Drupal / Joomla / whatever functions or constants are not available.

The above could mean that the means of installing CiviVolunteer is being incorrectly applied, or that CiviVolunteer installation is broken. I don't know which; if you expand your question to describe the steps you're taking to install CiviVolunteer, that could improve the quality of answer you can get.

  • The comment in that mentioned file goes on to say "this code should be removed in CiviCRM 4.3/4.4 when we adopt exception handling" - CiviCRM 4.3 came out in 2013 I think. Commented Oct 15, 2017 at 19:21
  • Thanks. Tricky thing. I don't think that the uninstall script for civivolunteer cleans up properly. Started hacking it. Tried debugging it, but I understand there is a shell script that is run in the install somewhere that would have to be debugged, not just civicrm. The stack trace just says failed at createTable - no information on what. Watchdog no detail of course. So mysql audit. INSERT INTO civicrm_custom_group... Thanks for ruling out the environment.
    – Interlated
    Commented Oct 16, 2017 at 20:05
  • I've added some more comments. Would you describe the steps you're taking to install CiviVolunteer, and maybe link to the documentation you're working from? That might shed light on how it's possible to be installing an extension without PEAR loaded. (If your hosting environment has preloaded a file called PEAR.php, that could prevent CiviCRM's PEAR.php being included later and defining this constant?) Commented Oct 16, 2017 at 21:37
  • Installed the extension by selecting from the civicrm UI. Prior to 4.7 we used git to manage, but the download and push install method seems to be the latest way. I've got a local copy (homebrew install php), so will see about the pear libraries being called. The software instance of CiviCRM is new - git rm -r /unzip/. Had CiviCRM for about 10 years.
    – Interlated
    Commented Oct 17, 2017 at 1:45
  • 1
    Nice work, and good on you for persisting 😄 I see this same CiviVolunteer issue has been asked/answered on SE before, and there's a couple of issues in JIRA about this (VOL-299, CRM-19546). If you want to engage this further, you could try there or on chat.civicrm.org Commented Oct 18, 2017 at 6:00

The genuine error message you're looking for is likely buried in the stack trace that CiviCRM will have written to the CiviCRM log file, and will likely require some sleuthing.

As per Chris' notes, it probably indicates an unhandled exception in CiviVolunteer, and helping them handle it better would be very nice.

Shameless plug: you can use this extension to make it easy to view/parse that log file.

  • That extension looks great, thanks for plugging it! Commented Oct 18, 2017 at 3:19

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.