How to load sqlite extension in PDO?

后端 未结 3 2206
萌比男神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:25

    could not find a compiler flag and we have solved it with a quick'n dirty hack in pdo_sqlite extension. patched sqlite_driver.c with sqlite3_enable_load_extension() from sqlite3 API.

    --- php-5.3.7.old/ext/pdo_sqlite/sqlite_driver.c    2012-01-06 11:04:44.000000000 -0500
    +++ sqlite_driver.c 2012-01-06 08:16:58.000000000 -0500
    @@ -718,6 +718,8 @@
            goto cleanup;
        }
     
    +   sqlite3_enable_load_extension(H->db, 1);
    +
        if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
            sqlite3_set_authorizer(H->db, authorizer, NULL);
        }
    

提交回复
热议问题