Re: JSON1 extension for SQLite
| From: | Jan Ehrhardt | Date: | Thu, 21 Feb 2019 08:11:57 +0000 |
| Subject: | Re: JSON1 extension for SQLite | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-326712@lists.php.net to get a copy of this message | ||
"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
#ifdef ZTS
if ((strncmp(sapi_module.name, "cgi", 3) != 0) &&
(strcmp(sapi_module.name, "cli") != 0) &&
(strncmp(sapi_module.name, "embed", 5) != 0)
) {
php_sqlite3_error(db_obj, "Not supported in multithreaded Web
servers");
RETURN_FALSE;
}
#endif
This code did not change from PHP 7.0:
https://github.com/php/php-src/blob/PHP-7.0/ext/sqlite3/sqlite3.c#L366
--
Jan