PVM is a lightweight, high-performance command-line PHP Version Manager for Windows, rewritten in Rust for maximum speed, security, and portability. It allows you to easily install, switch between, and configure different versions of PHP on your machine.
- Zero Config Setup: Automatically clean up existing PHP paths and configure Windows Environment Variables system-wide.
- Auto Import: Automatically detect pre-existing PHP installations on your system during setup and register them under PVM.
- Registry Refresh: Instantly updates environment variables for newly opened terminal windows without needing a computer reboot.
- Database Cache: Uses a local SQLite database to persist installations and cached remote release URLs.
- Extension Control: Enable extensions (like
curl) or open PHP folders natively in Notepad/Explorer.
- Download PVM: Extract the PVM application folder to a permanent directory of your choice on your system (e.g.
C:\tools\pvm). - Configure PATH: Open a Command Prompt or PowerShell window as an Administrator and execute:
pvm setup
- This command will detect if you have any existing PHP installations, import them, add PVM's directory to the System PATH, and clean up conflicting paths automatically.
- Restart Shell: Open a new terminal window to begin using
pvmglobally.
List all PHP versions available for download from windows.php.net:
pvm list-remoteDownload, extract, and register a specific PHP version:
pvm install 8.3.3- Use the
--typeflag to download Thread Safe (ts) version instead of Non-Thread Safe (nts- default):pvm install 8.3.3 --type ts
List all locally installed PHP versions registered under PVM:
pvm listSwitch the active PHP version to the specified version:
pvm use 8.3.3Add a manually downloaded or pre-existing local PHP directory to PVM:
pvm add --version 8.2.10 --path C:\path\to\php-8.2.10Remove a registered PHP version and delete its local directory:
pvm uninstall 8.3.3- Enable extension: Uncomments the extension inside the active
php.inifile:pvm ext-enable curl - Open extension folder: Opens the active PHP version's extensions folder in Windows Explorer:
pvm ext
Open the active PHP configuration (php.ini) file directly in Notepad:
pvm iniEnsure you have Rust installed (Edition 2024).
- Clone the repository and navigate to the directory:
git clone https://github.com/sagarkarn/PVM.git cd PVM
- Build the optimized release binary:
cargo build --release - The executable will be generated at
target/release/PVM.exe.
This project is licensed under the MIT License.