Roundcube Community Forum

Release Support => Pending Issues => Topic started by: jNk on December 04, 2009, 10:59:08 AM

Title: Cannot redeclare PEAR Error
Post by: jNk 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.
Title: Cannot redeclare PEAR Error
Post by: SKaero 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.
Title: Cannot redeclare PEAR Error
Post by: jNk 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
Title: Cannot redeclare PEAR Error
Post by: SKaero on December 04, 2009, 11:53:27 AM
Can you do a search and find all of the PEAR.php files on your system?
Title: Cannot redeclare PEAR Error
Post by: jNk 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/
Title: Cannot redeclare PEAR Error
Post by: SKaero 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?
Title: Cannot redeclare PEAR Error
Post by: jNk 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 ?
Title: Cannot redeclare PEAR Error
Post by: jNk on December 14, 2009, 12:06:34 PM
Any new thoughts?
Title: Cannot redeclare PEAR Error
Post by: SKaero 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?
Title: Cannot redeclare PEAR Error
Post by: jNk 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.
Title: Cannot redeclare PEAR Error
Post by: SKaero 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
Title: Cannot redeclare PEAR Error
Post by: jNk 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)
Title: Cannot redeclare PEAR Error
Post by: SKaero 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.
Title: Cannot redeclare PEAR Error
Post by: jNk 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
Title: Cannot redeclare PEAR Error
Post by: SKaero 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?
Title: Cannot redeclare PEAR Error
Post by: jNk on December 15, 2009, 11:33:23 AM
Dont see any info related to this problem in the apache error log.
The RC 2.1 pear.php in the RC 3.1 generates error message too, refering to the same : Cannot redeclare _pear_call_destructors()
Title: Cannot redeclare PEAR Error
Post by: SKaero on December 15, 2009, 11:54:40 AM
Well I have run out of ideas that's one very odd error that your getting, and I have hit my limit of odd error PEAR knowledge. Try asking the RoundCube mailing list and/or posting on Server Fault (http://serverfault.com/) there is a lot of smart people who may have run into this error at some point.
Title: Cannot redeclare PEAR Error
Post by: jNk on December 15, 2009, 12:08:08 PM
Thanks for your effort and I hope somewhere somebody has got unlimited limit of odd errors knowledge :)

I will post the solution here when I've got it.
Title: how to fix it?
Post by: register88 on April 10, 2010, 07:47:36 AM
I have this error in the roundcube log too.
anyone know how to fix it?
PHP Fatal error:  Cannot redeclare _pear_call_destructors() in /httpd/mail/program/lib/PEAR.php on line 771

I also noticed the other problem, when i first login (count of httpd start),roundcube just show me the blank page, after this i can login every time.

please help, thank you.