Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.4

Bug #7573 Fatal error: Class 'MDB2' not found
Submitted: 2006-05-07 18:51 UTC
From: hammam at islamway dot net Assigned: quipo
Status: Bogus Package: Translation2 (version CVS)
PHP Version: 5.1.2 OS: winxp
Roadmaps: (Not assigned)    
Subscription  


 [2006-05-07 18:51 UTC] hammam at islamway dot net (hammam)
Description: ------------ when i test the code you wrote in the introduction here : http://pear.php.net/manual/en/package.internationalization.translation2.intro.php this message was appear: Fatal error: Class 'MDB2' not found in C:\wamp\www\tests\Translation2\Container\mdb2.php on line 109

Comments

 [2006-05-07 18:57 UTC] quipo (Lorenzo Alberton)
you have to install MDB2: pear install MDB2 it is listed as an optional dependency because you can use other containers (DB, MDB, gettext, ...), but if you want to use MDB2 you obviously need to install it...
 [2006-07-08 00:03 UTC] jcscott at scottcomm dot com (John Scott)
I get a similar error, although I have MDB2 installed. Warning: loadclass(MDB2/Driver/mysql.php): failed to open stream: No such file or directory in /usr/lib/php/MDB2.php on line 335 Warning: loadclass(): Failed opening 'MDB2/Driver/mysql.php' for inclusion (include_path='.:/usr/lib/php') in /usr/lib/php/MDB2.php on line 335 MDB2 Error: not found
 [2006-07-08 06:17 UTC] quipo (Lorenzo Alberton)
you have installed the MDB2 base class only, but you also need the mysql driver: pear install MDB2_Driver_mysql
 [2007-01-14 03:51 UTC] lethe at charter dot net (Joe)
I'm also having this error. I have both MDB2 and MDB2_Mysql_driver installed. What should I do?
 [2007-01-14 09:29 UTC] quipo (Lorenzo Alberton)
What's the output of $ pear list ? Are you sure the include path is set correctly? Can you try installing the CVS version of MDB2?
 [2007-01-14 16:16 UTC] lethe at charter dot net (lethe)
Hi Lorenzo. Thanks for replying. Here is the output of pear list: avernus:~ lethe$ pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.1 stable Console_Getopt 1.2 stable MDB2 2.3.0 stable MDB2_Driver_mysql 1.3.0 stable PEAR 1.4.11 stable I'm not sure about the include path. This is my first PEAR package. But if the include path were incorrect, wouldn't I get an error from the require_once statement? Like if I change require_once 'MDB2.php' to require_once 'MDB2x.php', I get a different error, like failed to open stream: No such file or directory in /usr/local/apache2/htdocs/mdb2.php on line 2. Anyway, where do I check that? My php.ini file? I find this section of my php.ini: ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" It looks like it's commented out? I added this line to my php.ini: include_path = ".:/usr/local/lib/php/" (that's where my MDB2.php file is) but I still get the error. OK. I've solved it. I added the line print_r(get_included_files()); after my include statement, and it said /usr/local/apache2/htdocs/mdb2.php. In other words, I had (stupidly) named my test file the same thing (up to case) as the file to be included. The require_once statement was just including the test file itself. I've changed the name of the test file, and now everything is working. Thanks for your help, Lorenzo, and sorry to waste your time on what turned out to be a stupid error!
 [2007-01-14 22:47 UTC] quipo (Lorenzo Alberton)
> Here is the output of pear list: mmm... Translation2 isn't listed? > In other words, I had named my test file > the same thing (up to case) as the file > to be included. The require_once statement > was just including the test file itself. that's a very common mistake ;-) > I've changed the name of the test file, > and now everything is working. great. > Thanks for your help, Lorenzo, and sorry > to waste your time on what turned out > to be a stupid error! np
 [2007-02-14 01:53 UTC] ci_pong at hotmail dot com (newbie)
hi i'm a newbie and i don't have linux installed in my computer. i used wamp to run apache, php and mysql. I was wondering on how to install MDB2 in windows?
 [2007-02-14 07:40 UTC] quipo (Lorenzo Alberton)
from a DOS prompt, write pear install --alldeps MDB2_Driver_mysqli if you want the mysqli driver, or change the driver name if you want another one. http://pear.php.net/manual/en/installation.php
 [2007-02-14 20:47 UTC] ci_pong at hotmail dot com (newbie)
hi, thank you for replying. when i typed pear install --alldeps MDB2_Driver_mysqli, it says "'pear' is not recognized as an internal or external command, operable program or batch file." I have downloaded MDB2_Driver_mysqli-1.3.0 and MDB2-2.3.0.tgz could you please help me? thank you very much
 [2007-02-15 00:10 UTC] ci_pong at hotmail dot com (newbie)
Hi, I got pear working already. But i have another problem "Call to undefined method MDB2_Error::query()" could you help me with this error
 [2007-02-15 08:18 UTC] quipo (Lorenzo Alberton)
you need to check for errors before the query() call. if (PEAR::isError($res)) { echo $res->getMessage(). ' :: '. $res->getUserInfo(); } Anyway, since yours is NOT a bug report, please use the pear-general mailing list if you need support, don't abuse the bug reporting system. Thank you.
 [2008-05-23 06:36 UTC] suman2039 (Suman Jojiju)
hello, I called this in the constructor : $this->_oConn =& MDB2::connect(DSN); if (PEAR::isError($this->_oConn) ) { catchExc($this->_oConn->getMessage()); } and in other functions as $sql = "SELECT account_id FROM ".PREFIX."_accounts WHERE account_screenname='".$sScreenName."' and deleted=0"; if (PEAR::isError($rsTmp = $this->_oConn->query($sql))) { catchExc($rsTmp->getMessage()); return false; } // return matching number of rows $return = $rsTmp->numRows(); return $return; still Call to undefined method MDB2_Error::query()" occurs what may be the problem then??
 [2008-05-25 16:37 UTC] quipo (Lorenzo Alberton)
$this->_oConn is probably a PEAR_Error object, check that your connection is valid.