Why does PHP5 SQLite PDO fail silently when connecting a database?

I have no idea why my code is failing. PDO and PDO SQLite confirmed loaded. Errors are included and other errors are displayed.

SQLite file exists. Perm installed correctly. If I change the file name, PHP actually CREATES the file, but still fails. After the " $dbh = new PDO($db_conn);" command, the output or commands are not output. I'm not sure what else I can do to troubleshoot.

What else ... this is on shared hosting Modwest. The 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 the PHP CLI on the same server. This time I get an error: " Segmentation Error ".

+3
1

, PDO pdo_sqlite, sqlite.

0

Source: https://habr.com/ru/post/1740098/


All Articles