Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibSQL extension layer #564

Open
speniti opened this issue Oct 24, 2024 · 2 comments
Open

LibSQL extension layer #564

speniti opened this issue Oct 24, 2024 · 2 comments

Comments

@speniti
Copy link

speniti commented Oct 24, 2024

Hello!
I recently came across Turso, that seems a great fit for serverless applications and, since it requires an additional extension, I am trying to add a new layer to install it.

So, following the steps provided in the documentation, I built this Dockerfile:

ARG PHP_VERSION
ARG BREF_VERSION

FROM bref/build-php-$PHP_VERSION:$BREF_VERSION AS ext

COPY --from=composer /usr/bin/composer /usr/bin/composer

RUN composer global require darkterminal/turso-php-installer \
  && /root/.config/composer/vendor/bin/turso-php-installer install --yes
RUN echo 'extension=liblibsql_php.so' > /tmp/ext.ini

# Build the final image with just the files we need
FROM scratch

# Copy things we installed to the final image
COPY --from=ext /root/.turso-client-php/liblibsql_php.so /opt/bref/extensions/liblibsql_php.so
COPY --from=ext /tmp/ext.ini /opt/bref/etc/php/conf.d/ext-liblibsql.ini

The Docker build runs smoothly, but when I try to run the test with the command make test it fails with the following error:

Warning: PHP Startup: Unable to load dynamic library 'liblibsql_php.so' (tried: /opt/bref/extensions/liblibsql_php.so (/lib64/libm.so.6: version `GLIBC_2.29' not found (required by /opt/bref/extensions/liblibsql_php.so)), /opt/bref/extensions/liblibsql_php.so.so (/opt/bref/extensions/liblibsql_php.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
FAIL: Class "LibSQL" does not exist.
make: *** [test] Error 1

The problem seems related to GLIBC_2.29 that is missing but, unfortunately, it is not clear to me where/how to install it properly.
Can anyone help me to solve this issue, please?

Thanks! 🙏

@speniti
Copy link
Author

speniti commented Oct 28, 2024

Searching on the web, the issue seems related to the Bref's Docker image that, at the moment, is based upon Amazon Linux 2 and it contains GLIB.2.26. So this open PR should fix it.

@notrab
Copy link

notrab commented Nov 4, 2024

Turso released a new LibSQL composer package which depends on ffi.enable. Is it possible to allow that configuration with fpm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants