Skip to content

Add PHP 8.5 patch for pdo_sqlsrv #1217

Closed

Description

@vkoori

Add a PHP 8.5 compatibility patch to ensure pdo_sqlsrv builds and functions correctly with PHP 8.5.

Activity

  1. mlocati commented on Dec 28, 2025

    @mlocati
    Owner

    Are you referring to a specific patch? Or are you asking me to check why pdo_sqlsrv doesn't compile and patch it?

  2. mlocati commented on Dec 28, 2025

    @mlocati
    Owner

    (in the second case, it's better to ask to the authors of the pdo_sqlsrv extension - see https://github.com/Microsoft/msphpsql)

  3. double-daruma commented on Dec 30, 2025

    @double-daruma

    Looks like there is no upstream support for PHP 8.5 yet.

    Issue asking for support: microsoft/msphpsql#1539
    Not yet merged PR that supposedly fixes the build: microsoft/msphpsql#1543

  4. mvorisek commented on Feb 11, 2026

    @mvorisek
    Contributor

    Microsoft is very slow with releases. Usually 1 - 2 years :(

    I tried to utilize #538 to install the ext from local source:

    FROM php:8.5
    
    COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
    
    RUN apt-get -y update \
        && apt-get -y upgrade \
        && apt-get -y install git
    
    # make debugging faster - these packages are installed by install-php-extensions for pdo_sqlsrv
    RUN apt-get -y install libltdl7 libodbc2 libodbcinst2 unixodbc unixodbc-common apt-transport-https dirmngr gnupg gnupg-l10n gpg gpg-agent gpgconf gpgsm libassuan9 libgcrypt20 libgpg-error0 libksba8 libncursesw6 libnpth0t64 libodbccr2 pinentry-curses unixodbc-dev
    
    # download pdo_sqlsrv sources
    RUN git clone https://github.com/microsoft/msphpsql.git -b dev pdo_sqlsrv \
        && cd pdo_sqlsrv && git reset --hard b3e4bf2944 && rm -r .git
    
    # https://github.com/microsoft/msphpsql/blob/b3e4bf2944/buildscripts/README.md?plain=1#L19
    RUN cd pdo_sqlsrv && cp -r source/shared source/pdo_sqlsrv
    
    RUN install-php-extensions $(realpath pdo_sqlsrv/source/pdo_sqlsrv)
    

    But it fails with Unable to find the package.xml file in the directory.

    @mlocati is there any way how to create minimal package.xml and build the ext from source directly?

  5. mlocati commented on Feb 11, 2026

    @mlocati
    Owner

    @mlocati is there any way how to create minimal package.xml and build the ext from source directly?

    A Google search resulted in https://pear.php.net/manual/en/pyrus.commands.make.php

  6. mvorisek commented on Feb 11, 2026

    @mvorisek
    Contributor

    Thanks, I put the answer #558 (comment) in related issue.

  7. temp commented on Feb 27, 2026

    @temp

    sqlsrv and pdo_sqlsrv 5.13.0 was just released: https://github.com/microsoft/msphpsql/releases/tag/v5.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions