Skip to content

Instantly share code, notes, and snippets.

@developernotes
Created November 21, 2012 22:01
Show Gist options
  • Save developernotes/4128151 to your computer and use it in GitHub Desktop.
Save developernotes/4128151 to your computer and use it in GitHub Desktop.
Dump the SQLCipher version in PHP
<?php
try {
$db = new SQLite3("demo.db");
$version = $db->query("PRAGMA cipher_version");
if($version){
var_dump($version->fetchArray());
} else {
throw new Exception($db->lastErrorMsg());
}
$db->close();
}
catch (Exception $e){
echo "Exception", $e->getMessage(), "\n";
}
?>
@magdutra
Copy link

Nick, I've noted you've helped lots of people with SQLCipher and PHP issues, so I humbly come to you in the hope that you can provide me some guidance as well. I need to implement SQLite encryption in a x64 Windows Apache/PHP installation. I've managed to compile PHP and SQLCipher separately (using both VS2015 and MinGW-w64), but I don't know what to do to integrate them both. If I try to simply replace the original PHP files with those generated by SQLCipher's, I get a compilation error ("undefined struct sqlite3_mutex"). Can you point me in any direction? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment