-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Feature Request]: Support to Thread Safe builds #6
Comments
Hi @harrysbaraini, thank you for using this extension. What's file you add in your I never used FYI: this extension is not using PDO driver. |
I am on phone now, so sorry for not much detail. I followed the instructions in Readme and added the so extension to my ini. As soon as I get back to my laptop I'll give a bit more detail. |
Oki... |
@darkterminal I just have a simple Dockerfile, where I download the compiled extension and add it to php.ini. FROM composer
FROM dunglas/frankenphp:1.2-php8.3
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN install-php-extensions \
intl \
pdo_mysql \
pdo_pgsql \
zip \
redis \
pcntl \
posix
RUN apt update && \
apt install -yq ca-certificates wget unzip npm && \
rm -rf /var/cache/apt/* /tmp/*
RUN wget https://github.com/tursodatabase/turso-client-php/releases/download/turso-php-extension-v1.2.6/libsql_php-turso-php-extension-v1.2.6-php-8.3-x86_64-unknown-linux-gnu.tar.gz \
&& tar -xf libsql_php-turso-php-extension-v1.2.6-php-8.3-x86_64-unknown-linux-gnu.tar.gz \
&& mv libsql_php-turso-php-extension-v1.2.6-php-8.3-x86_64-unknown-linux-gnu/liblibsql_php.so $(php -i | grep ^extension_dir | cut -d " " -f 5) \
&& echo "extension=liblibsql_php.so" > /usr/local/etc/php/conf.d/liblibsql_php.ini \
&& rm -rf libsql_php-turso-php-extension-v1.2.6-php-8.3-x86_64-unknown-linux-gnu \
&& rm -f libsql_php-turso-php-extension-v1.2.6-php-8.3-x86_64-unknown-linux-gnu.tar.gz
WORKDIR /app
Warning: PHP Startup: libsql_php: Unable to initialize module
Module compiled with build ID=API20230831,NTS
PHP compiled with build ID=API20230831,TS
These options need to match
in Unknown on line 0
[PHP Modules]
Core
ctype
curl
[...] Meanwhile, I'll try to compile FrankenPHP without thread-safety so I can evaluate Turso. It will work but with some drawbacks (dunglas/frankenphp#601 (comment)). I'll still keep trying to compile this library locally, and if works I can happily open a PR. |
Thank you for your report! I will try to compile this using PHP NTS. But you can also create PR if you want. |
It looks like it's already compiled as NTS, in this case it should be compiled with Thread-Sagety enabled I think. Thank you! |
I tried to find some guidance in README or a Contributing.md but didn't find it. Could you briefly explain how do you compile? I have rust and cross installed in my macbook. I then run |
You can compile following this Actions command: About the error: https://stackoverflow.com/a/67830648 |
FrankenPHP gives me: 447.3 TURSO CLIENT PHP SUCCESSFULLY INSTALLED!
447.3 To get extension class autocompletion you need to modify your IDE Settings
447.3 in this case VSCode Settings:
447.3 - Open your VSCode setting (cmd/ctrl+,) then search "intelephense.stubs"
447.3 - add this: /root/.turso-client-php value on the lists
447.3 Thank you for using Turso Database!
447.3
447.3 + echo extension=/root/.turso-client-php/liblibsql_php.so
447.3 + php -m
447.3 + grep -q libsql
447.3 PHP Warning: PHP Startup: libsql_php: Unable to initialize module
447.3 Module compiled with build ID=API20230831,NTS
447.3 PHP compiled with build ID=API20230831,TS
447.3 These options need to match
447.3 in Unknown on line 0 PHP compiled for FrankenPHP is Thread Safe :) |
@andersonpem It seems that the error generated occurs because the PHP version used is different from the downloaded binary. Btw, I never used FrankenPHP before. |
For setting up the shivammathur/setup-php@v2 with thread safe PHP, go: jobs:
run:
runs-on: ubuntu-latest
name: Setup PHP TS
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
env:
phpts: ts # specify ts or nts |
Hi folk! Btw, I planned to adding some commands that might be very helpful for installing this extension in a non-interactive environment, like: Description:
Install Turso libSQL Extension for PHP
Usage:
install [options]
Options:
-y, --yes Skip interactive installation process
--php-version[=PHP-VERSION] Define your chosen PHP Version: 8.0, 8.1, 8.2, 8.3 default: Your Current PHP Version
--php-ini-file[=PHP-INI-FILE] Define your PHP INI file location: eg: /etc/php/<version>/cli/php.ini default: /etc/php/<version>/cli/php.ini
--ext-destination[=EXT-DESTINATION] Define your PHP Extension Destination: eg: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/ default: /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
|
Description
Hello, first of all, thank you for such great work.
I'm trying to get it working with FrankenPHP (that uses thread safe builds) but Turso php client seems to be built with PHP NTS. For that reason, I get
PHP Warning: PHP Startup: Unable to load dynamic library
error.I cloned this repo locally but I have almost zero knowledge on rust. Guidance or support to it would be appreciated. I'm evaluating Turso for a new enterprise application, but I'd like to stitch with Franken too for its Mercury feature as well.
Thank you.
Describe the solution you'd like
I'm on a Macbook M2. I'm updated Dockerfile to use
php:8.3-zts
as the base docker image, but when runningcross build ...
I get this error:could not create home directory: '/.rustup': Permission denied (os error 13)
. I tried setting up RUSTUP_HOME on host but it didn't work as well.Describe alternatives you've considered
No response
The text was updated successfully, but these errors were encountered: