php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19220 Warning: driver initialization failed in c:Apache/1.3.24
Submitted: 2002-09-03 20:07 UTC Modified: 2002-09-04 20:57 UTC
From: sky4lace at hotmail dot com Assigned:
Status: Not a bug Package: DBM/DBA related
PHP Version: 4.2.2 OS: Windows NT 5.0 build 2195
Private report: No CVE-ID: None
 [2002-09-03 20:07 UTC] sky4lace at hotmail dot com
Constantly getting this error and am not able to make any progress. I believe this to be a bug on PHP installed as a module.

Warning: driver initialization failed in c:\program files\apache group\apache\htdocs\anyatha3\login_fes\login_test.php on line 11
Failed opening existing dba file:passwords.db 
Warning: Unable to find DBA identifier 0 in c:\program files\apache group\apache\htdocs\anyatha3\login_fes\login_test.php on line 26

Warning: Unable to find DBA identifier 0 in c:\program files\apache group\apache\htdocs\anyatha3\login_fes\login_test.php on line 37
USERID = 

The script that I am running is:

<?php
  $handler_name = "db3";
  $file_name    = "passwords.db";
#  $file_path    = "../../ua_fes";
  $file_mode    = "passwords";
  $user_id      = "adrianlunga";
  $user_pwd     = "password";

 if (file_exists($file_name))
   {
   $db_id = dba_open($file_name, "w", $handler_name);
   if (!$db_id)
     {
     echo "Failed opening existing dba file:".$file_name."\n";
     }
   }
 else
   {
   $db_id = dba_open($file_name, "n", $handler_name);
   if (!$db_id)
     {
     echo "Failed opening new dba file:".$file_name."\n";
     }
   }

 if (dba_exists($file_name, $user_id))
   {
   $last_seen = dba_fetch($user_id, $db_id);
   }
  else
   {
  # dba_insert($file_name, $userid, $password);
   }

# do_stuff();
# dba_replace($string_handlername, $userid, time());
 dba_close($db_id);

  echo ("<HTML>");

    echo ("<HEAD>");
      echo ("<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">");
      echo ("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=windows-1252\">");
      echo ("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"../../../main.css\">");
      echo ("<TITLE>");
        echo ("Login Page");
      echo ("</TITLE>");
    echo ("</HEAD>");

    echo ("<BODY TEXT         =\"black\"");
      echo ("    LINK         =\"blue\"");
      echo ("    VLINK        =\"black\"");
      echo ("    ALINK        =\"blue\"");
      echo ("    BACKGROUND   =\"../images/indtextb.jpg\"");
      echo ("    BGPROPERTIES =\"fixed\"");
    echo (">");
      echo "USERID = ".$last_seen;
    echo ("</BODY>");
  echo ("</HTML>");

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-03 20:20 UTC] kalowsky@php.net
This sounds more like a local user error than a PHP error.  Are you sure you have a) permissions to write the file, and b) permissions to read the file?
 [2002-09-04 20:49 UTC] sky4lace at hotmail dot com
Thanks man. It was indeed permissions. Had overlooked the idea that Windows 2000 is not really a standalone system i.e. it is trying to mimic Unix in that it is trying to be a multi-use environment.
 [2002-10-29 15:24 UTC] adamLDelves at btinternet dot com
I am having the same problem. When ever I call dba_open () function I get the driver initialization failed.

I have apache 2.xx installed on a Win 2K system and PHP 4 running as CGI. I read the above comment about permissions but as i am new to PHP and apache and am not at all familiar with unix i will need an idiots explanation.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC