Web lists-archives.com

Re: JSON1 extension for SQLite

On 21.02.2019 at 09:11, Jan Ehrhardt wrote:

> "Christoph M. Becker" in php.general (Wed, 20 Feb 2019 20:47:16 +0100):
>> On 20.02.2019 at 20:23, Yves Goergen wrote:
>>> $this->connection->loadExtension('json1');   // or json1.dll
>>> --> Not supported in multithreaded Web servers
>> 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.
> In a way it is a XAMPP issue, because XAMPP sticks to mod_php and PHP
> threadsafe (ZTS). Upgrading to PHP 7.3 will not help:
> https://github.com/php/php-src/blob/PHP-7.3/ext/sqlite3/sqlite3.c#L358

If JSON1 is enabled during *compile-time*, there is no need to
*dynamically* load the extension, see <https://3v4l.org/SXa30>.  Under
ZTS environments, that's the only possibility to use SQLite3 extensions.

Christoph M. Becker