Saturday, June 13, 2009

Fatal error: Cannot redeclare _pear_call_destructors()

I was using PEAR HTML_Quick_forms and using my ISP PEAR.php and Quickform.php I got following message..

Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in /home/myusername/myuserincludes/PEAR/PEAR.php:765) in /usr/lib/php/PEAR.php on line 796

Solution:
I made following change in Quickform.php...
line
require_once 'PEAR.php';
replace with line
require_once 'PEAR5.php';

just force to use PEAR5

You may also change PEAR.php by adding if (!function_exists("_pear_call_destructors()")){
before line
function _pear_call_destructors(){
also add } after end of Function.

2 comments:

Ben Curnow said...

Great. Thanks. Fixed my problem.

Unknown said...

Thks.. It also helps me to fixed my problem.