Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

528
Visualizações
Cannot loadExtension in SQLite3 module, PHP

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?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

  • "Not supported in multithreaded Web servers"

This won't work on IIS anyway, which is (apperently) preferable for me. According to this (line 414) it is only enabled in ZTS(Zend Thread Safety). Disabling it is discussed here. Still no idea what's wrong with Apache config.

  • 'Unable to load extension' because of non-standard entry point. Can I specify custom entry point somehow?

Nnnope. Maybe someone should add a "custom entry point" feature request to PHP tracker, it doesn't seem that difficult.

  • "SELECT load_extension('example.dll', 'custom_init');" - fails with error "not authorized".

You have to call sqlite3_enable_load_extension before doing load_extension from query, and there is no analogue of sqlite3_enable_load_extension in php-sqlite. Patching PDO-Sqlite for this is described here, but it's very unsafe. Adding this as new feature in php-sqlite would be much better.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda