diff --git a/README.md b/README.md index cc8e3f6..cd88e36 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,40 @@ 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 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. + +--- + +## 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 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 3710472..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" @@ -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" 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"