Re: Pear help

From: Date: Mon, 28 Feb 2005 16:49:59 +0000
Subject: Re: Pear help
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38705@lists.php.net to get a copy of this message
Craig Hoffman wrote:
Hi There, I'm trying to configure my OS X box to work with PEAR. Everything seems to be working (updating PEAR libraries, etc.) except when I run my test script I get the following error: Fatal error: Cannot redeclare class db in /usr/lib/php/DB.php on line 271 Here is my test script: <?php require 'DB.php';
    if (class_exists('DB'))    {
        print 'Ok';
        } else {
                print 'Nope';
                }
?> I've included the path in my PHP.INI file and I still get this error. I've tested this script on another PEAR server and it works fine. Does anyone have any ideas? If this is wrong list, my apologies. Any help would be greatly appreciated.
Comment out the 'require' line - and run your test script. I expect you'll get the result "Ok". If so, you have something somewhere that's already including DB.php. Are you running this test script from within something, or do you actually include some 'common libraries' (your own custom, or some frameworks?). You may also try changing it to require_once, in case something is already require'ing it. The error is clearly stating that there's already a "class DB" defined. It's defined somewhere. Cheers, -- - Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital.

« previous php.db (#38705) next »