I need to use extension example.dll
with SQLite3 object in PHP. Extension has non-standard entry point custom_init
. sqlite3.extension_dir
in php.ini is specified properly. Tried the following code:
$dbconn = new SQLite3('test.db');
$dbconn->loadExtension('example.dll');
$dbconn->exec("SELECT load_extension('example.dll');");
As one can see, I used two approches to load it.
First approach: $dbconn->loadExtension('sqldba.dll');
.
- Doesn't work on my XAMPP/Apache with error
Not supported in multithreaded Web servers
, albeit it is done especially for this. What can be wrong in XAMPP/Apache configuration? - On one not so well-known HTTP server it returns 'Unable to load extension' because of non-standard entry point. Can I specify custom entry point somehow?
Second approach: $dbconn->exec("SELECT load_extension('example.dll', 'custom_init');");
.
- Fails with error
not authorized
. Is there any way to call sqlite3_enable_load_extension here? I can't find such function in "SQLite for PHP" module documentation.
Upd: somehow related: How to load sqlite extension in PDO?