Menu

Failed loading Pear:DB

Help
2006-02-13
2013-04-16
  • Nobody/Anonymous

    Hello,
    my conf is:
    www: W2K server
    DB: Oracle

    I can't install the db.
    "Failed loading Pear:DB"

    What do I need to check?

    Thanks

     
    • Bryce Nesbitt

      Bryce Nesbitt - 2007-09-16
       
    • Nobody/Anonymous

      To make PEAR work on Windows, you simple need to add the PEAR installation dir (e.g. c:\php\pear) to the include_path directive in your php.ini.

      http://pear.php.net/manual/en/faq.php#faq.users

      May be, it helps

       
    • Bryce Nesbitt

      Bryce Nesbitt - 2008-07-01

      <?php

      //  A small standalone test file, to check if pear:db is working
      //  Part of php bug tracker

      echo "Your php include path is: \&quot;" . ini_get('include_path') . "\&quot;<br/>";

      define('PEAR_PATH', '');
      if (@include_once(PEAR_PATH.'DB.php')) {
          echo 'Pear DB module loaded OK!<br/>';
          } else {
          echo 'Error: Failed to load the PEAR DB.php module from the path. Check for the file "DB.php" in the path.<br/>';
          }

      $dsn = array(
      'phptype'   => 'mysqli',
      'hostspec'  => 'localhost',
      'database'  => 'bug_tracker',
      'username'  => 'xxxxxxxx',
      'password'  => 'yyyyyyyyy'
      );

      $db = DB::Connect($dsn);
      if (DB::isError($db)) {
          echo 'Failed to connect to the database: '. $db->getMessage() .'<br/>';
          } else {
          echo 'Database opened OK!<br/>';

          $result =& $db->query("SELECT bug_id,title,created_date from phpbt_bug");
          if (DB::isError ($result))
           die ("SELECT failed: " . $result->getMessage () . "\n");
          printf("Result set contains %d rows and %d columns<br/>\n",
              $result->numRows (), $result->numCols ());
          printf("<table border=1>\n");
          while ($row =& $result->fetchRow ()) {
              printf("<tr><td>%s</td><td>%s</td><td>%s</td>\n", $row[0], $row[1], $row[2]);
              }
          $result->free();
          printf("</table>\n");
          }

      //  Uncomment the next line for lots of information about php setup
      //  phpinfo(8+4);
      ?>

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.