From d6172e858798011c061a0895a8cfc893b29ab7ea Mon Sep 17 00:00:00 2001 From: Irfan Hardiyanto <52022757+devhardiyanto@users.noreply.github.com> Date: Thu, 23 Jul 2026 22:03:25 +0700 Subject: [PATCH 1/4] =?UTF-8?q?fix(linux):=20macOS=20build=20=E2=80=94=20p?= =?UTF-8?q?ass=20explicit=20gmp=20prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gmp is keg-only on Homebrew and ships no pkg-config file, so the PKG_CONFIG_PATH prepend can't locate it and configure fails with "GNU MP Library version 4.2 or greater required". Mirror the gettext handling: on Darwin with brew, use --with-gmp=$(brew --prefix gmp). Linux keeps the bare flag (system libgmp-dev). devhardiyanto --- linux/phpvm.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/linux/phpvm.sh b/linux/phpvm.sh index 3710472..8deb4f8 100644 --- a/linux/phpvm.sh +++ b/linux/phpvm.sh @@ -484,6 +484,15 @@ phpvm_install() { gettext_opt="--with-gettext=$(brew --prefix gettext)" fi + # gmp is keg-only on Homebrew AND ships no pkg-config (.pc) file, so the + # PKG_CONFIG_PATH prepend below can't find it — configure needs the explicit + # prefix or it fails with "GNU MP Library version 4.2 or greater required". + # Linux resolves --with-gmp from the system libgmp-dev, so leave it bare. + local gmp_opt="--with-gmp" + if [[ "$(uname -s)" == "Darwin" ]] && command -v brew &>/dev/null; then + gmp_opt="--with-gmp=$(brew --prefix gmp)" + fi + local configure_opts=( "--prefix=$target" "--with-config-file-path=$target/etc" @@ -513,7 +522,7 @@ phpvm_install() { "--with-webp" "--with-freetype" "$gettext_opt" - "--with-gmp" + "$gmp_opt" "--with-pgsql" "--with-pdo-pgsql" "--with-onig" From 13a2d60108f4f071d5c4e57e3df871a80c7cc64a Mon Sep 17 00:00:00 2001 From: Irfan Hardiyanto <52022757+devhardiyanto@users.noreply.github.com> Date: Thu, 23 Jul 2026 22:04:00 +0700 Subject: [PATCH 2/4] docs: document PECL hash + sqlsrv ODBC limitations Two honest known-limitation entries so users don't file them as bugs: - Windows PECL DLLs aren't SHA-256 verified because windows.php.net publishes no checksums for PECL archives (B3, won't-fix upstream). - ext install sqlsrv/pdo_sqlsrv needs the system-wide MS ODBC Driver; not a phpvm bug (S10.5). devhardiyanto --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index cc8e3f6..8b8c20b 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,33 @@ terminal. Linux: make sure your `~/.bashrc` / `~/.zshrc` sources `~/.phpvm/phpvm.sh`. Note that auto-switch never installs missing versions — it only switches between installed ones. +### `ext install sqlsrv` / `pdo_sqlsrv` fails or won't connect + +This is **not** a phpvm bug. The PHP extension is only half of the stack — at +runtime it also needs Microsoft's ODBC Driver for SQL Server, installed +system-wide (one-off, outside phpvm). phpvm prints this note after install. + +- Windows: [Download ODBC Driver 18](https://learn.microsoft.com/sql/connect/odbc/download-odbc-driver-for-sql-server) +- Linux/macOS: [Install the ODBC driver](https://learn.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server) + +If the PECL build itself fails, it's a toolchain/driver-header gap on your +machine (`unixODBC-devel` / ODBC SDK), not something phpvm can bundle. + +--- + +## Known limitations + +- **PECL extensions on Windows are not hash-verified.** phpvm enforces SHA-256 + on the PHP core zip and the Xdebug DLL, but `windows.php.net` does not publish + checksums for its [PECL release archives](https://windows.php.net/downloads/pecl/releases/), + so there is nothing to verify against. Downloads still go over HTTPS. If your + threat model requires it, build the extension from source instead of pulling + the prebuilt DLL. (Linux/macOS build extensions via PECL from source, so this + gap is Windows-only.) +- **macOS is experimental.** Building PHP from source relies on Homebrew deps + and is exercised only in CI (non-gating). FPM user/group defaults assume + Linux. See the Compatibility table. + --- ## Compatibility From 6d38e4ab3f534693babcd4bc1fe9f6906f865bd0 Mon Sep 17 00:00:00 2001 From: Irfan Hardiyanto <52022757+devhardiyanto@users.noreply.github.com> Date: Thu, 23 Jul 2026 22:08:48 +0700 Subject: [PATCH 3/4] chore: bump version to 1.12.2 devhardiyanto --- linux/install.sh | 2 +- linux/phpvm.sh | 2 +- version.txt | 2 +- windows/install.ps1 | 2 +- windows/phpvm.ps1 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/linux/install.sh b/linux/install.sh index 272f5ba..b7c271e 100644 --- a/linux/install.sh +++ b/linux/install.sh @@ -6,7 +6,7 @@ set -e -PHPVM_VERSION="1.12.1" +PHPVM_VERSION="1.12.2" PHPVM_DIR="${PHPVM_DIR:-$HOME/.phpvm}" PHPVM_REPO="https://raw.githubusercontent.com/devhardiyanto/phpvm/main" diff --git a/linux/phpvm.sh b/linux/phpvm.sh index 8deb4f8..f119ecc 100644 --- a/linux/phpvm.sh +++ b/linux/phpvm.sh @@ -10,7 +10,7 @@ # phpvm use 8.3.0 # ============================================================================== -PHPVM_VERSION="1.12.1" +PHPVM_VERSION="1.12.2" PHPVM_DIR="${PHPVM_DIR:-$HOME/.phpvm}" PHPVM_VERSIONS="$PHPVM_DIR/versions" PHPVM_CURRENT="$PHPVM_DIR/current" diff --git a/version.txt b/version.txt index 6f165bc..69669de 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.12.1 \ No newline at end of file +1.12.2 \ No newline at end of file diff --git a/windows/install.ps1 b/windows/install.ps1 index c23cac9..27380d9 100644 --- a/windows/install.ps1 +++ b/windows/install.ps1 @@ -8,7 +8,7 @@ Set-StrictMode -Version Latest $ErrorActionPreference = "Stop" -$PHPVM_VERSION = "1.12.1" +$PHPVM_VERSION = "1.12.2" $PHPVM_DIR = if ($env:PHPVM_DIR) { $env:PHPVM_DIR } else { "$env:USERPROFILE\.phpvm" } $PHPVM_BIN = "$PHPVM_DIR\bin" diff --git a/windows/phpvm.ps1 b/windows/phpvm.ps1 index ffbc458..71a4c4c 100644 --- a/windows/phpvm.ps1 +++ b/windows/phpvm.ps1 @@ -15,7 +15,7 @@ Set-StrictMode -Version Latest $ErrorActionPreference = "Stop" # -- Constants ----------------------------------------------------------------- -$PHPVM_VERSION = "1.12.1" +$PHPVM_VERSION = "1.12.2" $PHPVM_DIR = if ($env:PHPVM_DIR) { $env:PHPVM_DIR } else { "$env:USERPROFILE\.phpvm" } $VERSIONS_DIR = "$PHPVM_DIR\versions" $CURRENT_LINK = "$PHPVM_DIR\current" From 293bea23a0476e2028526df0eda516d227990a27 Mon Sep 17 00:00:00 2001 From: Irfan Hardiyanto <52022757+devhardiyanto@users.noreply.github.com> Date: Thu, 23 Jul 2026 22:10:35 +0700 Subject: [PATCH 4/4] docs: note ODBC Driver 18-vs-17 Encrypt default gotcha Driver 18 defaults Encrypt=yes, so connections that worked on 17 fail TLS against local/dev SQL Server with a self-signed cert. Document the TrustServerCertificate/Encrypt workaround and the 2012+ requirement so users don't blindly install 18. devhardiyanto --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b8c20b..cd88e36 100644 --- a/README.md +++ b/README.md @@ -313,9 +313,16 @@ This is **not** a phpvm bug. The PHP extension is only half of the stack — at runtime it also needs Microsoft's ODBC Driver for SQL Server, installed system-wide (one-off, outside phpvm). phpvm prints this note after install. -- Windows: [Download ODBC Driver 18](https://learn.microsoft.com/sql/connect/odbc/download-odbc-driver-for-sql-server) +- Windows: [Download the ODBC Driver](https://learn.microsoft.com/sql/connect/odbc/download-odbc-driver-for-sql-server) - Linux/macOS: [Install the ODBC driver](https://learn.microsoft.com/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server) +**Driver 18 vs 17 gotcha:** the PHP extension works with either, but Driver 18 +changed the `Encrypt` default from `no` to **`yes`** — so a connection that +worked before now fails TLS against a local/dev SQL Server with a self-signed +certificate. Either add `Encrypt=yes;TrustServerCertificate=yes` (or +`Encrypt=no`) to your connection string, or install Driver 17. Driver 18 also +requires SQL Server 2012+; older servers (2008/R2) need Driver 17. + If the PECL build itself fails, it's a toolchain/driver-header gap on your machine (`unixODBC-devel` / ODBC SDK), not something phpvm can bundle.