开发者

Why is PHP5 SQLite PDO silently failing on DB connection?

开发者 https://www.devze.com 2022-12-26 02:42 出处:网络
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.

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 fa开发者_开发问答ils 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".


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

0

精彩评论

暂无评论...
验证码 换一张
取 消