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

Add sqlanywhere to connect to sqlanywhere instances #917

Open
leroy0211 opened this issue Apr 27, 2024 · 1 comment
Open

Add sqlanywhere to connect to sqlanywhere instances #917

leroy0211 opened this issue Apr 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@leroy0211
Copy link

leroy0211 commented Apr 27, 2024

Add sqlanywhere php extension (and driver) to connect to sqlanywhere servers. Comes with acceptance of a license agreement, so I'm not sure how this should be done with php-extension-installer.

The extension requires a client driver to be installed too. I'm not sure if php-extension-installer need to install it, because the client could be a different version.

We usually run the following with version sqlanywhere client version 17:

# multi staged build 
FROM ...   AS sqlanywhere
ENV        SQLANYWHERE_PHP="https://s3.amazonaws.com/sqlanywhere/drivers/php/sasql_php.zip" \
           SQL_ANYWHERE_CLIENT="http://d5d4ifzqzkhwt.cloudfront.net/sqla17client/sqla17_client_linux_x86x64.tar.gz"

RUN        apt update && apt install -yq zip
RUN        curl -s ${SQLANYWHERE_PHP} -o sasql_php.zip && unzip sasql_php.zip -d /tmp/sasql_php
RUN        curl -sL ${SQL_ANYWHERE_CLIENT} | tar xz -C /tmp
RUN        cd /tmp/sasql_php && phpize && ./configure && make
RUN        cd /tmp/client17011 && ./setup -install sqlany_client64 -silent -nogui -I_accept_the_license_agreement

# the app build
FROM       php

ENV        LD_LIBRARY_PATH="/opt/sqlanywhere17/lib64" \
           SQLANY17="/opt/sqlanywhere17"

COPY       --from=sqlanywhere    /opt /opt
COPY       --from=sqlanywhere    /tmp/sasql_php/modules/sqlanywhere.so /usr/local/lib/php/extensions/sqlanywhere.so

RUN        echo "extension=/usr/local/lib/php/extensions/sqlanywhere.so" > /usr/local/etc/php/conf.d/sqlanywhere.ini
@leroy0211 leroy0211 added the enhancement New feature or request label Apr 27, 2024
@mlocati
Copy link
Owner

mlocati commented Apr 29, 2024

Do you know if they have plans to publish sqlanywhere to pecl.php.net? I see that there are https://pecl.php.net/package/sqlanywhere and https://pecl.php.net/package/PDO_SQLANYWHERE but they seems outdated/unmaintained...

(Maintaining support for installing packages published on pecl is much easier)

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

No branches or pull requests

2 participants