I have the following:

drupal 5.6
Civicrm 1.9
phpCAS files 5.1

When I go to the admin modules list after unpacking all the files I get:

Fatal error: Cannot redeclare class PEAR in /civicrm/packages/PEAR.php on line 103

Civicrm doesn't throw the error without the files being unpacked.

Comments

metzlerd’s picture

I don't really think that this is CAS related bug. Your error message points to a problem in civicRM. Is there something that would make you believe that this is a CAS module problem. Happy to help, but can you tell me what makes you think this is related to CAS?

Dave

epicflux’s picture

When I unpacked the CAS module, along with the phpCAS files this error appears, when I delete them the error doesn't appear... I just assumed it had something to do with the CAS module since I've setup a lot of other modules alongside CiviCRM and never experienced this issue.

Since you have a better understanding of how the CAS system works you might be better at spotting the issue, but it certainly could solely be a CiviCRM issue.

Do you know if anyone else has setup this module along side CiviCRM?

metzlerd’s picture

My best guess is that the cas client is using pear and so is civicrm. I do know that the module code doesn't directly do anything with PEAR. So I'm at a loss as to how to advise you. Are you putting supporting libraries in your include path, or are you downloading third party PEAR extensions and putting them in the modules directory? If this is the case I might be able to sort this out, but if it isn't then there isn't much I have control of here. I can't find any direct includes or class definitions in my version of the phpCAS client. So I'm betting civicrm is trying to overload some PEAR definitions. If that's true you may need to get the civicrm pear functions into your php include path in order to sort this out.

It's certainly uncommon for drupal modules to use PEAR database extentions, so it doesn't surprise me that you haven't had this problem with other modules.

Am I helping or making sense here?

c960657’s picture

CiviCRM comes with its own copy of PEAR, so what probably happens is that CiviCRM loads its own copy of PEAR.php and some other module loads another copy, possibly the copy installed globally on the server.

I'd prefer that CiviCRM could use the global copy of PEAR, but I haven't looked into whether this is possible/recommended.

metzlerd’s picture

Status: Active » Closed (duplicate)

changing this issue to won't fix since there's not something I can do. There's a feature request for eliminating the phpCAS libarary at http://drupal.org/node/396916 so further progress towards removing any pear dependencies can be tracked there.