A vfox / mise plugin for managing PHP versions.
- Dynamic version fetching: Automatically fetches available versions from PHP's GitHub repository
- Always up-to-date: No static version list to maintain
- Compiles from source: Uses official PHP source releases
- Automatic Composer: Installs Composer after PHP
- Cross-platform: Works on Linux and macOS
xcode-select --install
brew install autoconf bison re2c pkg-config \
libxml2 openssl@3 icu4c zlib libzip oniguruma \
freetype jpeg libpng webp gmp libsodium readline bzip2sudo apt-get install build-essential autoconf bison re2c pkg-config \
libxml2-dev libssl-dev libicu-dev libzip-dev libonig-dev \
libcurl4-openssl-dev libpng-dev libjpeg-dev libfreetype6-dev \
libwebp-dev libgmp-dev libsodium-dev libreadline-dev libbz2-devsudo dnf groupinstall "Development Tools"
sudo dnf install autoconf bison re2c pkgconfig \
libxml2-devel openssl-devel libicu-devel libzip-devel oniguruma-devel \
libcurl-devel libpng-devel libjpeg-devel freetype-devel \
libwebp-devel gmp-devel libsodium-devel readline-devel bzip2-develmise install php@latest
mise install [email protected]
mise install [email protected]vfox add php
vfox install php@latest# List all available versions
mise ls-remote php
# Install a specific version
mise install [email protected]
# Set global version
mise use -g [email protected]
# Set local version (creates .mise.toml)
mise use [email protected]This plugin sets the following environment variables:
PATH- Adds the PHP bin and sbin directoriesLD_LIBRARY_PATH- Adds PHP lib directory (Linux only)
Add extra configure options:
PHP_EXTRA_CONFIGURE_OPTIONS="--with-pdo-sqlite" mise install [email protected]Or override all configure options (prefix is always added):
PHP_CONFIGURE_OPTIONS="--with-openssl --enable-mbstring" mise install [email protected]The default build includes many common extensions:
- Database: mysqli, pdo_mysql, pdo_pgsql (if libpq available)
- String: mbstring, intl, gettext, iconv
- Compression: zlib, bz2, zip
- Crypto: openssl, sodium
- Graphics: gd (with freetype, jpeg, png, webp)
- Other: curl, bcmath, calendar, exif, fpm, pcntl, soap, sockets
This plugin:
- Fetches available versions from github.com/php/php-src tags
- Downloads the source tarball for the requested version
- Runs
./buildconf --forceto generate configure script - Configures with platform-appropriate options
- Compiles with
make && make install - Installs Composer
If you see errors about missing libraries, install them via Homebrew:
brew install libxml2 openssl@3 icu4cMake sure pkg-config can find your libraries. The plugin sets PKG_CONFIG_PATH automatically for Homebrew packages, but you may need to install pkg-config:
brew install pkg-configPHP compilation typically takes 5-15 minutes depending on your hardware. The plugin uses parallel compilation (make -j) to speed this up.
MIT License - see LICENSE for details.