How to load sqlite extension in PDO?

后端 未结 3 2210
萌比男神i
萌比男神i 2020-12-28 21:14

First, I want to inform about the case to avoid the misunderstanding.

By sqlite extension, I mention Sqlite\'s extension like FTS, not PHP\'s sqlite extension.

3条回答
  •  时光取名叫无心
    2020-12-28 21:24

    I have implemented a library with a solution for this problem for PHP 7.4+ which does not involve recompiling the PDO driver. In short, it uses PHP's FFI extension and Z-Engine (which reads PHP's internal memory structures using FFI) to make a direct call to the SQLite C API. You can find more detailed background information in this blog post. I would not recommend this solution in production yet, but it could be a feasible workaround for test or development workflows.

提交回复
热议问题