I have Ubuntu 24.04 and php 8.3. I’m trying to connect to an Access DB through PDO ODBC running on the command line. Here is what I have enabled:
$ php -i | grep PDO
PDO
PDO support => enabled
PDO drivers => mysql, odbc
PDO Driver for MySQL => enabled
PDO_ODBC
PDO Driver for ODBC (unixODBC) => enabled
code:
<?php
$access_file = './myfile.mdb';
$db=new PDO('odbc:Driver=MDBTools; DBQ=' . $access_file . ';');
?>
error:
Segmentation fault (core dumped)
That’s all I get, no other information. I am able to connect to and run queries on this mdb file with DBeaver, so the file should be ok. I haven’t been able to find what would cause a Segmentation fault just by creating the PDO connection.
I tried mdbtools. If I run the mdb-ver it returns “JET4”. If I run mdb-sql I can run queries and they return correctly. I also tried “describe table” and it worked correctly, too. So it looks like everything is working correctly with the mdbtools.
I found some old .mdb files that I created years ago for an Access class. I was able to load and run queries on them in DBeaver and work with them using mdb-tools, but again I get the Segmentation fault with them when trying to open them with PHP. It seems to be something specific to PHP.