Author Topic: Cannot redeclare PEAR Error  (Read 12206 times)

Offline jNk

  • Jr. Member
  • **
  • Posts: 10
Cannot redeclare PEAR Error
« on: December 04, 2009, 10:59:08 AM »
Hi!

I have upgraded roundcubemail from 0.2.1 to version 0.3.1
Followed the wiki/Howto_Upgrade page and it went smoothly but I get a error when I try to start my new roundcube website.

The error log:

Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in PEAR.php:771) in /raid/sites/rc-test/program/lib/PEAR.php on line 811

This is a Ubuntu 8.04 LTS OS and the 0.2.1 version is still working perfectly in another vhost.


Any thoughts or help would be appreciated.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cannot redeclare PEAR Error
« Reply #1 on: December 04, 2009, 11:31:07 AM »
It sound like a pear conflict, rename [RC root]/program/lib/PEAR.php to something else and see if the problem goes away.

Offline jNk

  • Jr. Member
  • **
  • Posts: 10
Cannot redeclare PEAR Error
« Reply #2 on: December 04, 2009, 11:44:18 AM »
I've renamed it, but the problem still exists although as the error message says in the "main" pear.php

Error message :

Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in PEAR.php:771) in /usr/share/php/PEAR.php on line 811

The two pear.php are the same filesize since I've upgraded the package from 1.6.1 to 1.9.0 via console : pear upgrade PEAR

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cannot redeclare PEAR Error
« Reply #3 on: December 04, 2009, 11:53:27 AM »
Can you do a search and find all of the PEAR.php files on your system?

Offline jNk

  • Jr. Member
  • **
  • Posts: 10
Cannot redeclare PEAR Error
« Reply #4 on: December 04, 2009, 12:08:31 PM »
I've got the following directories with PEAR.php in the system :

/tmp/pear/cache/PEAR-1.9.0/

/home/me/backup/roundcubemail-0.2-beta/program/lib/
/home/me/backup/roundcubemail-0.2-1/program/lib/
/home/me/backup/roundcubemail-0.3-stable/program/lib/

/raid/sites/site1/public_html/includes/PEAR/
/raid/sites/site1/public_html/libraries/pear/
/raid/sites/site2/roundcubemail/program/lib/
/raid/sites/site3/rc-test/libraries/pear/

/usr/share/php/

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cannot redeclare PEAR Error
« Reply #5 on: December 04, 2009, 12:26:56 PM »
The only one I see that could be causing a problem is the cause is the /tmp/pear/cache/PEAR-1.9.0/ try renaming it, also is your pear include path?

Offline jNk

  • Jr. Member
  • **
  • Posts: 10
Cannot redeclare PEAR Error
« Reply #6 on: December 04, 2009, 01:39:12 PM »
The /tmp/pear/cache/PEAR-1.9.0/ was created by the pear itself when i've upgraded it from 1.6.1 to 1.9.0. I thought it worth a try to upgrade, because the problem was there with a v1.6.1 too. Anyway, renamed it, still dont works.
Where can I check the include path ? in the /program/include/iniset.php ?

Offline jNk

  • Jr. Member
  • **
  • Posts: 10
Cannot redeclare PEAR Error
« Reply #7 on: December 14, 2009, 12:06:34 PM »
Any new thoughts?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cannot redeclare PEAR Error
« Reply #8 on: December 15, 2009, 08:27:49 AM »
If you put back the PEAR.php in the RoundCube directory (where it was before) and remove the _pear_call_destructors function from it does the error go away?

Offline jNk

  • Jr. Member
  • **
  • Posts: 10
Cannot redeclare PEAR Error
« Reply #9 on: December 15, 2009, 09:35:34 AM »
I removed the suggested lines from 771 to 811 and another errors appears:

Fatal error: Cannot redeclare class PEAR in /raid/sites/roundtest/program/lib/PEAR.php on line 88


I'm not a php guru but the two call to the removed function in the line 170 and 246 doesnt sounds good.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cannot redeclare PEAR Error
« Reply #10 on: December 15, 2009, 09:45:46 AM »
It still sounds like a path error to me, try setting a fixed path at the end of the [RC root]/config/main.inc.php using set_include_path http://php.net/manual/en/function.set-include-path.php

Offline jNk

  • Jr. Member
  • **
  • Posts: 10
Cannot redeclare PEAR Error
« Reply #11 on: December 15, 2009, 10:14:18 AM »
Updated main.inc.php :

$path = '/raid/sites/roundtest/program/lib';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

// end of config file
?>

with the original pear.php back to the first error message :

Cannot redeclare _pear_call_destructors() (previously declared in PEAR.php:771)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cannot redeclare PEAR Error
« Reply #12 on: December 15, 2009, 10:36:27 AM »
Ok lets try a all out rampage and deleting everything in the RoundCube PEAR.php file and leave it as a blank file and see what that gives you.

Offline jNk

  • Jr. Member
  • **
  • Posts: 10
Cannot redeclare PEAR Error
« Reply #13 on: December 15, 2009, 10:56:02 AM »
That is rampage mode indeed and the consequence is a little bit strange :

Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in PEAR.php:771) in /raid/sites/roundtest/program/lib/PEAR.php on line 811

That PEAR.php is a absolute empty 0 kbyte file.

Edit:
I love the difference bitween the browsers :
Opera says the error message above
Firefox shows a blank page
IExplore shows HTTP 500 Error
« Last Edit: December 15, 2009, 11:03:53 AM by jNk »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Cannot redeclare PEAR Error
« Reply #14 on: December 15, 2009, 11:08:27 AM »
Ok... Not what I was expecting, Is there anything in the Apache logs that would help? You said you still have RoundCube 2.1 running, if you copy the PEAR.php file from there to 3.1 does anything change?