Fatal error: Cannot redeclare _pear_call_destructors() (previously declared

Silver_2000

Well-Known Member
Mar 31, 2002
337
1
318
Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in /home/user/public_html/banners/lib/pear/PEAR.php:771) in /usr/lib/php/PEAR.php on line 802

Seems a recent cpanel update has chanegd the way that pear is being used

I looked at the php.ini and it appears to be ok

would love some clues as to where to look for change that would have happened in lat week

The error above is for openx banners BUT other apps are failing with similar errors
 

manjula.k

Registered
Apr 16, 2009
4
1
53
Create .htaccess file in the document root of openx (Note that you do not place it under the .htaccess of your domain document root) .

.htaccess should have the line

php_value include_path ".:/path/to/php/PEAR"

give the correct path to the php pear


Enable AllowOverride in your apache configuration

<Directory /home/user/../../openx_doumentroot>
AllowOverride all
</Directory>


Hope this helps.
 

Silver_2000

Well-Known Member
Mar 31, 2002
337
1
318
I appreciate the response but I would love to know what changed in the past few days of updates that would have resulted in this
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
I appreciate the response but I would love to know what changed in the past few days of updates that would have resulted in this
What is your full cPanel version number?

When did you last build Apache, PHP, etc?
 

Silver_2000

Well-Known Member
Mar 31, 2002
337
1
318
cPanel 11.24.4-R36167 - WHM 11.24.2 - X 3.9

I havent built apache or php in months

PHP Version 5.2.8
Apache/2.2.11

Something changed on the server in the last 7 days

Software add on alerts started getting emailed - havent seen them in months
and there are at least 2 applications with similar pear errors
 

manjula.k

Registered
Apr 16, 2009
4
1
53
Not sure . But i guess the cpanel update has something to do with the issue .

Hasn't the fix work for you ? Tell the php to include the local pear directory.

Instead of the .htaccess method try creating a file called php.ini and pasting the following source code into it:

include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/user/pear";

Make sure you change user to your actual cPanel username. Also the first two paths (/usr/lib/php:/usr/local/lib/php) should remain so that the default PHP libraries are loaded.

This php.ini file must be copied in each directory where pear packages are needed.
 

Silver_2000

Well-Known Member
Mar 31, 2002
337
1
318
another app broken by pear updates that have been denied

Catchable fatal error: Object of class MDB2_Error could not be converted to string in /home/userr/public_html/tree/classes/family_database.class.php on line 206
 

Silver_2000

Well-Known Member
Mar 31, 2002
337
1
318
cpanel support response to similar problem was that I had customized the pear config in this area of every account

/usr/local/apache/conf/userdata/std/2account_name/cp_php_magic_include_path.conf

trouble is the change was likely done by some setting in easy apache but Ive been given NO idea or clue as to what setting it was and how to undo it

can anyone tell me where these settings are set so I can undo it ?
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
/usr/local/apache/conf/userdata/std/2account_name/cp_php_magic_include_path.conf
Note: Apache userdata include files that begin with cp_ are installed by cPanel ( hence the cp in the name ).

This file in particular is installed in all virtual hosts by activating the PHP Magic User Loader. You can enable and disable this feature in WHM. To check or change this:

  • Login to WHM as root
  • Click Module Installers ( it is in the Software menu block )
  • Click the Manage link for PHP Extensions and Applications Package
  • The status of the Magic User Loader is at the top of the page

Disabling the magic loader will remove the include file and reference from all virtual hosts ( you might need to regenerate httpd.conf for this to take affect ).
 

Silver_2000

Well-Known Member
Mar 31, 2002
337
1
318
thanks for the info Kenneth
Support supposedly told my host that I had modified the files myself
The problem had nothing to do with 'pear updates' last time; if you remember, it was custom code inserted by the user in /usr/local/apache/conf/userdata/std/2/<USERNAME>/<DOMAINNAME>/
if this is a php config setting that ISNT "custom code"

ill check that setting in the am

just checked it - it was enabled and disabling fixed the multiple pear issues.

THANKS
 
Last edited:

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
thanks for the info Kenneth
Support supposedly told my host that I had modified the files myself


if this is a php config setting that ISNT "custom code"

ill check that setting in the am

just checked it - it was enabled and disabling fixed the multiple pear issues.

THANKS
I'm glad that worked. If by 'support' you mean the cPanel support team, please PM me the ticket number. Thank you.
 

Silver_2000

Well-Known Member
Mar 31, 2002
337
1
318
The ticket was put in by steadfast - My server and support is through them

I dont have the ticket number


here is quote that steadfast sent me from the Cpanel response to ticket


The problem had nothing to do with 'pear updates' last time; if you remember, it was custom code inserted by the user in /usr/local/apache/conf/userdata/std/2/<USERNAME>/<DOMAINNAME>/

If they're having issues with include paths, I strongly recommend they update them in their custom configurations (listed above) so that they do not have this issue. As you can understand, we do not troubleshoot customer code. In the previous ticket, while investigating the cause, I found their custom configuration and fixed their problem as a courtesy - but they need to look at their custom config in the future when addressing include problems like this, since they're setting custom directives for the very issue. Thank you.

To clarify, the customer is wrong when they say it's due to 'cPanel pear updates'. It's due to their custom include paths in the above-referenced include files, and it's something they need to fix in their own custom configurations. Thank you.
The frustrating part for me is that Im looking for "custom code"

When in fact I should have been looking for a cpanel check box. I admit that I likley checked that box BUT its not custom code to me ....
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Thank you for the quote. I'll search our ticket system for the ticket. It appears we have a training/documentation/information issue here that needs resolved.

Thank you for your persistence and patience.