bref icon indicating copy to clipboard operation
bref copied to clipboard

GLIBC Version is not supported to install Libsql extension of php.

Open rijalsubash opened this issue 1 year ago • 10 comments

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

rijalsubash avatar Dec 03 '24 02:12 rijalsubash

This probably can't be resolved until the Amazon Linux 2023 upgrade project is completed.

GrahamCampbell avatar Jan 17 '25 13:01 GrahamCampbell

Unless you can build the extension yourself linked against an older version of glibc, assuming the code compiles against that version.

GrahamCampbell avatar Jan 17 '25 13:01 GrahamCampbell

Ah that's too bad, I find Turso interesting for Lambda, I wish it could work before we move to AL2023…

mnapoli avatar Jan 18 '25 15:01 mnapoli

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. ;)

GrahamCampbell avatar Jan 19 '25 15:01 GrahamCampbell

Right, I don't think I'll have the time myself to dive into that for now 🥲

mnapoli avatar Jan 20 '25 09:01 mnapoli

It might be best to open an issue with Turso, @rijalsubash.

GrahamCampbell avatar Jan 20 '25 11:01 GrahamCampbell

A Google search brings me here: https://stackoverflow.com/questions/57749127/how-can-i-specify-the-glibc-version-in-cargo-build-for-rust.

GrahamCampbell avatar Jan 20 '25 11:01 GrahamCampbell

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?

speniti avatar Apr 17 '25 07:04 speniti

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?

mnapoli avatar Apr 17 '25 11:04 mnapoli

Hey @mnapoli, @GrahamCampbell, I've opened a PR to enable the FFI extension. The changes seem pretty straightforward everything looks good so far!

speniti avatar Apr 17 '25 15:04 speniti