msphpsql: aws | Debian 10/11 [hvm] (64-bit aarch64/Arm) | Unknown processor architecture

Hi there, we have a cloud project arm64/aarch64 based

We can’t use x86 arch. We must use new arm. we tried this script to force install correctly driver for arm, but php return “Unknown processor architecture.”

the script:

    sudo curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
    sudo printf "deb [arch=arm64,amd64] https://packages.microsoft.com/debian/10/prod buster main" | sudo tee /etc/apt/sources.list.d/mssql-release.list

    sudo apt update -y && sudo apt upgrade -y
    sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17

    # optional: for bcp and sqlcmd
    sudo ACCEPT_EULA=Y apt-get install -y mssql-tools
    echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
    source ~/.bashrc

    # optional: for unixODBC development headers
    sudo apt-get install -y unixodbc-dev

    # optional: kerberos library for debian-slim distributions
    sudo apt-get install -y libgssapi-krb5-2

    # install php 8 ext
    sudo pecl config-set php_ini /etc/php/8.0/fpm/php.ini
    sudo pecl install sqlsrv
    sudo pecl install pdo_sqlsrv

    sudo printf "; priority=20\nextension=sqlsrv.so\n" | sudo tee /etc/php/8.0/mods-available/sqlsrv.ini
    sudo printf "; priority=30\nextension=pdo_sqlsrv.so\n" | sudo tee /etc/php/8.0/mods-available/pdo_sqlsrv.ini

    sudo phpenmod -v 8.0 sqlsrv pdo_sqlsrv

php try script:

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$serverName = "serverName\\sqlexpress"; //serverName\instanceName

// Since UID and PWD are not specified in the $connectionInfo array,
// The connection will be attempted using Windows Authentication.
$connectionInfo = array( "Database"=>"dbName");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}
?>

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 22 (6 by maintainers)

Most upvoted comments

Can we +1 this somewhere?

Thanks @MwSpaceLLC for the info. I will mark this as a feature request for the management’s awareness.

AWS supports and recommends arm64, this is a blocking issue for us to move to arm64 ec2 instance

Thanks @MwSpaceLLC for the info. I will mark this as a feature request for the management’s awareness.

So I can see that Arm support is out The ARM64 architecture on Red Hat 8, 9, Debian 11, and Ubuntu 20.04, 22.04 are supported starting with version 18.1.

But wouldn’t it be realistic to get the .so file built for Alpine as well? Where does one push to get this done?

Issue can be closed I believe.

18.18 out now which has support for arm64 for Alpine ❤️‍🔥 thanks for that

Just to answer my own question regarding moving the extension from debian/ubuntu onto alpine, sadly as Alpine uses musl libc instead of glibc it won’t run - even with libc6-compat package installed.


ldd libmsodbcsql-18.2.so.1.1 
        /lib/ld-musl-aarch64.so.1 (0xffffb7b38000)
        libdl.so.2 => /lib/ld-musl-aarch64.so.1 (0xffffb7b38000)
        libodbcinst.so.2 => /usr/lib/libodbcinst.so.2 (0xffffb78f6000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xffffb7824000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0xffffb77c3000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xffffb757f000)
        libm.so.6 => /lib/ld-musl-aarch64.so.1 (0xffffb7b38000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xffffb754e000)
        libpthread.so.0 => /lib/ld-musl-aarch64.so.1 (0xffffb7b38000)
        libc.so.6 => /lib/ld-musl-aarch64.so.1 (0xffffb7b38000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xffffb750d000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0xffffb74ec000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0xffffb74cb000)
        libkeyutils.so.1 => /usr/lib/libkeyutils.so.1 (0xffffb74aa000)
Error relocating libmsodbcsql-18.2.so.1.1: __strcat_chk: symbol not found
Error relocating libmsodbcsql-18.2.so.1.1: __fdelt_chk: symbol not found
Error relocating libmsodbcsql-18.2.so.1.1: __snprintf_chk: symbol not found
Error relocating libmsodbcsql-18.2.so.1.1: __memmove_chk: symbol not found
Error relocating libmsodbcsql-18.2.so.1.1: __strncpy_chk: symbol not found
Error relocating libmsodbcsql-18.2.so.1.1: __memset_chk: symbol not found
Error relocating libmsodbcsql-18.2.so.1.1: __read_chk: symbol not found