Search for a command to run...
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:
.php-version file, with automatic switching when changing directoriesPHPENV_VERSIONphp, php-fpm, pecl, pyrus, and other PHP binaries under ~/.phpenv/versions/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.