views:

180

answers:

1

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. PHP Version is 5.2.6.

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!

ADDITIONAL NOTE: I tried a simple proof of concept of running this line of code in PHP CLI on the same server. This time I get an error: "Segmentation Fault".

A: 

Looks like it came from enabling PDO and pdo_sqlite but NOT sqlite itself.

danieltalsky