-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
Minimal replication instructions:
/Dockerfile
FROM php:8-apache
RUN apt-get update && apt-get install -y sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/*
COPY src/ /var/www/html/
COPY ini/php.ini /usr/local/etc/php/conf.d/php.ini/ini/php.ini
sqlite3.extension_dir = /var/www/html/sqlitehash/src/test.php
<?php
$db = new SQLite3(':memory:');
$db->loadExtension('libsqlite_hashes');
echo $db->querySingle("SELECT hex(sha256('oi'))");Running
$ mkdir -p /src/sqlitehash/ && cd /src/sqlitehash/
$ wget https://github.com/nyurik/sqlite-hashes/releases/download/v0.9.0/sqlite-hashes-x86_64-unknown-linux-gnu.tar.gz
$ tar -xzvf sqlite-hashes-x86_64-unknown-linux-gnu.tar.gzResults in the file
/src/sqlitehash/libsqlite_hashes.so is RELEASE 9.0
Running the following command should result in the error as demonstrated:
$ php test.php
Warning: SQLite3::loadExtension(): Unable to load extension at '/var/www/html/sqlitehash/libsqlite_hashes' in /var/www/html/test.php on line 3php -i | grep sqlite3.extension_dir
sqlite3.extension_dir => /var/www/html/sqlitehashHowever, when I run sqlite3 CLI, it just works.
$ cd /var/www/html/sqlitehash && sqlite3
SQLite version 3.40.1 2022-12-28 14:03:47
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .load ./libsqlite_hashes
sqlite> SELECT sha256('oi')
...> ;
��3cLİ/b��e
)���*
�A�%�w-�
Xԉ
sqlite> SELECT hex(sha256('oi'));
87F633634CC4B02F628685651F0A29B7BFA22A0BD841F725C6772DD00A58D489Any help would be much appreciated.
Metadata
Metadata
Assignees
Labels
No labels