Command Palette

Search for a command to run...

position in category
#13

PHP multi-version installation and management tool for running and switching between multiple PHP installations on a single machine. Injects itself into your PATH so any invocation of php, php-fpm, or related executables routes through phpenv, which selects the appropriate version based on project directory or environment.

Inspired by rbenv and ruby-build, with PHP-centric additions for building from source, managing pecl extensions, and custom configure options. Uses a plugin-based architecture: php-build handles compilation from the PHP source tree, while bash plugins allow extensive customization of the build and runtime behavior.

Key capabilities:

  • Per-project version via .php-version file, with automatic switching when changing directories
  • Global, local, and shell-specific version hierarchy, overridable via PHPENV_VERSION
  • Integration with php-build for compiling PHP from source with custom flags and extensions
  • Shims for php, php-fpm, pecl, pyrus, and other PHP binaries under ~/.phpenv/versions/
  • PHP-FPM and Apache SAPI support for connecting phpenv-managed PHP to webservers

Developers use phpenv to run legacy projects on older PHP releases while keeping newer work on current versions, to test applications across PHP 7.x and 8.x before upgrading, and to build PHP with custom options or extensions without affecting the system installation.

GitHub Repositories
5
25%
Trending up this week
Found in 1 more repo

Top repositories using phpenv

Most popular GitHub repositories that import or use phpenv

Most likely to be used with

Project using this technology also uses those, ordered by popularity
Cumulated Stars
3.1K
Missing something?