Roundcube Community Forum

 

Cannot redeclare PEAR Error

Started by jNk, December 04, 2009, 10:59:08 AM

Previous topic - Next topic

jNk

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.

SKaero

It sound like a pear conflict, rename [RC root]/program/lib/PEAR.php to something else and see if the problem goes away.

jNk

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

SKaero

Can you do a search and find all of the PEAR.php files on your system?

jNk

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/

SKaero

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?

jNk

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 ?

jNk


SKaero

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?

jNk

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.

SKaero

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

jNk

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)

SKaero

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.

jNk

#13
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

SKaero

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?