Web lists-archives.com

Re: JSON1 extension for SQLite




On 20.02.2019 at 20:23, Yves Goergen wrote:

> So this cannot be solved. I've changed my code from PDO to SQLite3 and
> get this error message instead:
> 
> $this->connection->loadExtension('json1');   // or json1.dll
> 
> --> Not supported in multithreaded Web servers
> 
> XAMPP does not support letting PHP's SQLite load extensions. For
> whatever reason. Maybe they're not capable of getting it right, I don't
> know. XAMPP has disappointed and (negatively) surprised me before.
> 
> https://community.apachefriends.org/viewtopic.php?p=211647
> 
> So I need to find another solution. That sucks.

This is not particularly an XAMPP issue, but rather a limitation of the
SQLite3 extension[1].  Anyhow, the simplest solution would be to use PHP
7.3, where the JSON1 extension of SQLite3 is supposed to be available in
the Windows builds by default[2].  If you need an older PHP version, you
likely have to compile ext/sqlite3 yourself.

[1]
<https://github.com/php/php-src/blob/623911f993f39ebbe75abe2771fc89faf6b15b9b/ext/sqlite3/sqlite3.c#L354-L361>.
[2] <https://github.com/php/php-src/blob/PHP-7.3/ext/sqlite3/config.w32#L6>

-- 
Christoph M. Becker