【发布时间】:2019-07-07 00:49:56
【问题描述】:
我正在尝试在 CentOS 上将 SQLite3 FTS5(全文搜索)与 PHP 结合使用。但经过这么长时间的尝试,我还是无法成功.
我正在为 SQlite 构建一个可加载的 FTS5 扩展,并尝试了以下步骤(来自 docs)
在服务器终端(SSH)中:
$ yum install libsqlite3x-devel
$ wget -c http://www.sqlite.org/src/tarball/SQLite-trunk.tgz?uuid=trunk -O SQLite-trunk.tgz
$ tar -xzf SQLite-trunk.tgz
$ cd SQLite-trunk
$ ./configure && make fts5.c
$ gcc -g -fPIC -shared fts5.c -o fts5.so
但我在最后一步出现以下错误:
fts5_index.c:732:11: error: ‘SQLITE_PREPARE_PERSISTENT’ undeclared (first use in this function)
fts5_index.c:732:37: error: ‘SQLITE_PREPARE_NO_VTAB’ undeclared (first use in this function)
fts5_main.c:888:29: error: ‘SQLITE_PREPARE_PERSISTENT’ undeclared (first use in this function)
fts5_main.c:1029:31: error: ‘SQLITE_PREPARE_PERSISTENT’ undeclared (first use in this function)
fts5_storage.c:139:15: error: ‘SQLITE_PREPARE_PERSISTENT’ undeclared (first use in this function)
fts5_storage.c:140:41: error: ‘SQLITE_PREPARE_NO_VTAB’ undeclared (first use in this function)
文件fts5.so没有生成,所以我不能在服务器上使用它
那么您知道如何修复此错误并成功生成fts5.so 文件
【问题讨论】:
标签: php sqlite centos full-text-search