GLIBC Version is not supported to install Libsql extension of php.
Description:
I am trying to use bref with Turso Database, which use Libsql extension.
I am using this extension. https://github.com/tursodatabase/turso-client-php/releases/tag/turso-php-extension-v1.4.0. which requires GLIBC_2.29 but bref docker image has GLIBC_2.27.
it throws following error
PHP Warning: PHP Startup: Unable to load dynamic library 'liblibsql_php' (tried: /opt/bref/extensions/liblibsql_php (/opt/bref/extensions/liblibsql_php: cannot open shared object file: No such file or directory), /opt/bref/extensions/liblibsql_php.so (/lib64/libm.so.6: version GLIBC_2.29' not found (required by /opt/bref/extensions/liblibsql_php.so)))`
How to reproduce: Here is my DockerFile
FROM bref/php-81-fpm:2
# Copy the extrnsion so file
COPY ./php/estensions/liblibsql_php.so /opt/bref/extensions/
# Copy the source code in the image
COPY . /var/task
# Configure the handler file (the entrypoint that receives all HTTP requests)
CMD ["public/index.php"]
and here is my php ini.
extension_dir=/opt/bref/extensions/
extension=liblibsql_php
This probably can't be resolved until the Amazon Linux 2023 upgrade project is completed.
Unless you can build the extension yourself linked against an older version of glibc, assuming the code compiles against that version.
Ah that's too bad, I find Turso interesting for Lambda, I wish it could work before we move to AL2023…
Unless you can build the extension yourself linked against an older version of glibc, assuming the code compiles against that version.
This is worth exploring, still. ;)
Right, I don't think I'll have the time myself to dive into that for now 🥲
It might be best to open an issue with Turso, @rijalsubash.
A Google search brings me here: https://stackoverflow.com/questions/57749127/how-can-i-specify-the-glibc-version-in-cargo-build-for-rust.
Hey, just wanted to let you know about a new library for integrating with Turso. It's pretty cool because it doesn't need the libSQL extension, but it does need the FFI extension. I gave the 'bref/extra-gd-php-84' Docker image a go, but sadly, the FFI extension isn't switched on. @mnapoli do you think it would be easier if we just installed the FFI extension by default?
I never realized we didn't enabled FFI. @GrahamCampbell do you know any downsides to enabling FFI in https://github.com/brefphp/aws-lambda-layers?
Hey @mnapoli, @GrahamCampbell, I've opened a PR to enable the FFI extension. The changes seem pretty straightforward everything looks good so far!