Why is PHP5 SQLite PDO silently failing on DB connection?
        Posted  
        
            by danieltalsky
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by danieltalsky
        
        
        
        Published on 2010-04-07T04:20:18Z
        Indexed on 
            2010/04/07
            4:23 UTC
        
        
        Read the original article
        Hit count: 359
        
I have no idea why my code is failing silently. PDO and PDO SQLite are confirmed loaded. Errors are turned on and OTHER errors display.
The SQLite file exists.  Perms are set correctly.  If I change the filename, PHP actually DOES create the file but still fails silently.  No output or commands are excecuted after the "$dbh = new PDO($db_conn);" command.  I'm not sure what else I can possibly do to troubleshoot.
What else... this is on Modwest shared hosting.
ABOUT TO RUN
<?php
 // Destination
 $db_name = '/confirmed/valid/path/DBName.db3';
 $db_conn = 'sqlite:' . $db_name;
 try
 {
  var_dump($db_conn);
  $dbh = new PDO($db_conn);
  $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 } catch (Exception $e) {
  exit("Failed to open database:  {$e->getMessage()} \n" );
 }
?>
THIS NEVER OUTPUTS!
sdf
© Stack Overflow or respective owner