-
Notifications
You must be signed in to change notification settings - Fork 70
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
Try to build the php-sqlsrv extension for the linux/arm64 platform #159
Comments
stronk7
changed the title
Try to build the php-sqlsrv extension for the inux/arm64 platform
Try to build the php-sqlsrv extension for the linux/arm64 platform
Jan 28, 2023
Hi @stronk7, diff --git a/root/tmp/setup/php-extensions.sh b/root/tmp/setup/php-extensions.sh
index cf56e5d..e61d194 100755
--- a/root/tmp/setup/php-extensions.sh
+++ b/root/tmp/setup/php-extensions.sh
@@ -77,11 +77,14 @@ echo "pcov.initial.files=1024" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.
# Install Microsoft dependencies for sqlsrv.
# (kept apart for clarity, still need to be run here
# before some build packages are deleted)
-if [[ ${TARGETPLATFORM} == "linux/amd64" ]]; then
- /tmp/setup/sqlsrv-extension.sh
-else
- echo "sqlsrv extension not available for ${TARGETPLATFORM} architecture, skipping"
-fi
+case $TARGETPLATFORM in
+ linux/amd64|linux/arm64)
+ /tmp/setup/sqlsrv-extension.sh
+ ;;
+ *)
+ echo "sqlsrv extension not available for ${TARGETPLATFORM} architecture, skipping"
+ ;;
+esac
# Keep our image size down..
pecl clear-cache
diff --git a/root/tmp/setup/sqlsrv-extension.sh b/root/tmp/setup/sqlsrv-extension.sh
index 4911851..b834cf1 100755
--- a/root/tmp/setup/sqlsrv-extension.sh
+++ b/root/tmp/setup/sqlsrv-extension.sh
@@ -5,14 +5,13 @@ set -e
# Install Microsoft dependencies for sqlsrv
echo "Downloading sqlsrv files"
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
-# TODO, bullseye should be 11, but the msodbcsql17 package is not available yet, hence using buster (10) one.
-curl https://packages.microsoft.com/config/debian/10/prod.list -o /etc/apt/sources.list.d/mssql-release.list
-apt-get update
+curl https://packages.microsoft.com/config/debian/11/prod.list -o /etc/apt/sources.list.d/mssql-release.list
+apt update
echo "Install msodbcsql"
-ACCEPT_EULA=Y apt-get install -y msodbcsql17
+ACCEPT_EULA=Y apt install -y msodbcsql18 mssql-tools18
-ln -fsv /opt/mssql-tools/bin/* /usr/bin
+ln -fsv /opt/mssql-tools18/bin/* /usr/bin
# Need 5.10.1 (or later) for PHP 8.2 support
pecl install sqlsrv-5.10.1 HTH, |
Hopefully solved in #164. Supported for PHP 8.0 onwards it seems, but not earlier. |
Closed by #164 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that, since June 2022 (version 5.10), there is support for arm64 in the php sqlsrv drivers/extension.
https://learn.microsoft.com/en-us/sql/connect/php/release-notes-php-sql-driver?view=sql-server-ver16
Let's give to it a try and check if now we can build it for our arm64 images.
The text was updated successfully, but these errors were encountered: