Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion linux/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
13 changes: 11 additions & 2 deletions linux/phpvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -513,7 +522,7 @@ phpvm_install() {
"--with-webp"
"--with-freetype"
"$gettext_opt"
"--with-gmp"
"$gmp_opt"
"--with-pgsql"
"--with-pdo-pgsql"
"--with-onig"
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12.1
1.12.2
2 changes: 1 addition & 1 deletion windows/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion windows/phpvm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading