SQLCipher integration to PHP


Hi there!

After a fairly reasonable struggle I managed to compile SQLCipher for use in a x64 Windows environment. However, I’m now pulling my hair out for something that in theory appears to be a much simpler task: compile PHP with the new sqlite3 files generated by SQLCipher.

If I copy the generated files over the original sqlite3.h and sqlite3.c in the directory ext/sqlite3/libsqlite of PHP, the compilation doesn’t complete and produces the following error: “Undefined structure sqlite3_mutex”.

If I add “–with-sqlite3=c:\sqlcipher” to the list of parameters of “configure”, the compilation goes fine but then nothing seems to be encrypted in my test database. I suspect the compilation made reference to the original files (which I have restored after the first compilation failure) instead of the SQLCipher’s.

I’m really lost… Any help would be much appreciated!




Hello @mdutra

First, my apologizes for the delay in response, I missed this post. Were you able to resolve your build issue?

Unfortunately, compiling SQLCipher on Windows for PHP is likely an involved task and not something we can easily assist you with in this forum as you are building a custom solution. If your organization is interested in licensing a turnkey solution using SQLCipher on Windows from PHP, please feel free to reach out to us at support@zetetic.net to discuss enterprise licensing further.