I totally understand, that there are lot of threads online about this issue, but I just don't seem to get it working, because a lot of them do not match with issue I'm having.
I'm integrating some custom code (written by random guy). When I run it, I get this:
PHP Fatal error: Cannot redeclare _PEAR_call_destructors() (previously declared in /var/www/my_project/classes/_externals/PEAR.php:773) in /usr/share/php/PEAR.php on line 777
And I understand the problem - the code includes its own PEAR.php
with same (?) code, but earlier that the other from system includes.
So it throws me an error. How could I solve this problem? Is it possible to tell PHP to everide definitions and functions? I think that would do it.
I'm running PHP 5.3.10-1ubuntu3.11
with Suhosin-Patch (cli) Apache Apache/2.2.22
I think you need to define your own include path with ini_set() in the code. I haven't faced this situation yet. I found this link:
http://forums.uber.com.au/showthread.php?1851-PEAR-Fatal-error-Cannot-redeclare
Hope this helps.
I have also get into the similar issue when i upgrade a site from prestashop 1.3 to prestashop 1.6.
I fixed it by delete all modules in the modules folder and then copy the files from the newly downloaded prestashop_x.zip modules folder.
That means some of the modules creating the problem. I haven't check it deeply. But it may give a way to analyze what is the problem.
Thanks.
I got the error when installing the new roundcube. The problem was likely that roundcube came with its own version of PEAR that conflicted with my debian-packaged version. This only manifested itself when I tried to send e-mails, but at that point, it showed up in the syslog.
I removed the pear
and pear-pear.php.net
folders from the vendor
folder in my roundcube installation. The problem has not reappeared, and roundcube seems to be working fine.
This problem will appear when you try to set_include_path
two times in source code. In included paths, available PEAR (of course, it also coincide).
The way to solve: Check included paths in source codes and php.ini
by get_include_path
function.