Skip to content

pdo_sqlsrv dropped from static binary defaults in the PHP 8.5 upgrade (#2168) — can it be restored? #2563

Description

@kiatng

Is your feature request related to a problem? Please describe.

pdo_sqlsrv was dropped from the static binary's default extension set as a side effect of the PHP 8.5 upgrade, and I think the reason for dropping it no longer applies.

Timeline:

I assume it was dropped because msphpsql didn't support PHP 8.5 at that moment — which was true on 2026-02-20. But msphpsql v5.13.0 shipped seven days later (2026-02-27) with "Support for PHP 8.4 and PHP 8.5", plus Alpine 3.20–3.23, which covers the musl target the fully-static build uses. v5.13.1 followed on 2026-04-30. pdo_sqlsrv is also still listed as supported by static-php-cli.

Effect on the released binary (FrankenPHP v1.12.3, PHP 8.5.6, fully-static Linux x86_64):

$ frankenphp php-cli -r 'print_r(PDO::getAvailableDrivers());'
Array
(
    [0] => mysql
    [1] => pgsql
    [2] => sqlite
)

Because fully-static musl binaries can't load extensions dynamically, there's no way to add it back at runtime — an app that talks to SQL Server has to either drop the static binary or shell out to a system PHP CLI for every query.

Describe the solution you'd like

Re-add pdo_sqlsrv to defaultExtensions in build-static.sh, now that msphpsql supports PHP 8.5 on the relevant targets.

If it's being deliberately kept out — binary size, the unixODBC/msodbcsql dependency, or musl build trouble — that's completely fair, and a note in docs/static.md saying so would save the next person the git archaeology. Happy to open a PR for either the extension or the doc note.

Describe alternatives you've considered

  • Building a custom static binary with PHP_EXTENSIONS=...,pdo_sqlsrv — works, but means maintaining our own build and release pipeline just to regain one extension that was previously in the default set.
  • Switching to the glibc-based mostly-static build, which can load extensions dynamically. The extension has to be compiled with ZTS support, and package managers don't ship ZTS builds, so this means compiling msphpsql by hand inside static-builder-gnu and keeping it in step with each upgrade.
  • Shelling out to a system PHP CLI that has pdo_sqlsrv installed. This is what we do today. It works, but it means the web runtime and the CLI runtime have different database capabilities, which is an awkward thing to design around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions