MDB2.php not found error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikeswire
    New Member
    • Mar 2010
    • 1

    MDB2.php not found error

    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_mys qli

    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

    Code:
    <?php
    require_once 'MDB2.php';
    $mdb2 = MDB2::connect('mysqli://root:mysql@localhost/test');
    if (PEAR::isError($mdb2)) {
        die($mdb2->getMessage()  .' , '. $mdb2->getDebugInfo());
    	}
    	else
    	 print 'connection succeeded';
    
    ?>
    Last edited by Atli; Mar 23 '10, 02:09 AM. Reason: Added [code]
  • philipwayne
    New Member
    • Mar 2010
    • 50

    #2
    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.

    Comment

    Working...