You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using PHP 7’s SQLite3 extension, the method SQLite3::loadExtension() improperly appends an additional ".so" to the filename provided, leading to load failure. While the SQLite CLI correctly loads the SQLite3 extension without requiring any file extension (e.g., sqlite> .load ./libsqlite_hashes, thus automatically appending the extension when needed), PHP 8 requires specifying the file extension, e.g., SQLite3::loadExtension('libsqlite_hashes.so'). Lastly, PHP 7 fails to load the SQLite3 extension with or without specifying the file extension as it ends up looking for a file with a double extension (e.g., libsqlite_hashes.so.so).
Notice that, loadExtension won't work in any PHP version (7 or 8) if the extension part of the SQLite 3 extension filename is omitted.
This behavior is not properly documented in the manual, which claims support for a broad range of PHP versions (PHP 5 >= 5.3.0, PHP 7, PHP 8) and do not emphasize the importance of specifying the file extension (e.g., .so for Linux).
The text was updated successfully, but these errors were encountered:
From manual page: https://www.php.net/manual/en/sqlite3.loadextension.php
When using PHP 7’s SQLite3 extension, the method SQLite3::loadExtension() improperly appends an additional ".so" to the filename provided, leading to load failure. While the SQLite CLI correctly loads the SQLite3 extension without requiring any file extension (e.g.,
sqlite> .load ./libsqlite_hashes
, thus automatically appending the extension when needed), PHP 8 requires specifying the file extension, e.g.,SQLite3::loadExtension('libsqlite_hashes.so')
. Lastly, PHP 7 fails to load the SQLite3 extension with or without specifying the file extension as it ends up looking for a file with a double extension (e.g., libsqlite_hashes.so.so).Reproducing steps can be found at nyurik/sqlite-hashes#71
Notice that, loadExtension won't work in any PHP version (7 or 8) if the extension part of the SQLite 3 extension filename is omitted.
This behavior is not properly documented in the manual, which claims support for a broad range of PHP versions (PHP 5 >= 5.3.0, PHP 7, PHP 8) and do not emphasize the importance of specifying the file extension (e.g.,
.so
for Linux).The text was updated successfully, but these errors were encountered: