By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,258 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,258 IT Pros & Developers. It's quick & easy.

MDB2.php not found error

P: 1
PHP and PEAR and MySQL Setup on Apache MDB2.php

note: error info after trying to connect includes 'MDB2.php' (include_path='.;C:\php5\pear')

I noticed some potential solutions on this in a closed post. After installing pear and installing mdb2 using the pear install. You have to install the driver for the db you will be accessing:

at a command prompt from tht php directory run this.
pear install MDB2_driver_mysqli

Note: the code below fails with the cannot find mdb2.php error (before the install above and works after). I found some info on this site as a solution to this error involving moving an ini file around, none of them worked for me but the install above did. I think it is an incomplete install bug not an ini bug.

FYI Good luck Mike A

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once 'MDB2.php';
  3. $mdb2 = MDB2::connect('mysqli://root:mysql@localhost/test');
  4. if (PEAR::isError($mdb2)) {
  5.     die($mdb2->getMessage()  .' , '. $mdb2->getDebugInfo());
  6.     }
  7.     else
  8.      print 'connection succeeded';
  10. ?>
Mar 21 '10 #1
Share this Question
Share on Google+
1 Reply

P: 50
Umm unless the file is in the correct directory then I doubt it will find a imaginary file. I think you've confused PHP's require with something like pyhon's/java's import. If you installed it, it is loaded through a DLL not a file( well it is a file but its a special file to the Windows operating systems ). The load happens automatically when apache starts.
Mar 21 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.