PVM (PHP Version Manager) is a lightweight PowerShell tool for Windows that makes it easy to install, switch, and manage multiple PHP versions.
Clone the repo and add the directory to you Path variable.
git clone https://github.com/drissboumlik/pvm
cd pvm
# Run this command to setup pvm
pvm setup# Display the avilable options
pvm help
# Display help for a specific command
pvm help <command>
# Display information about the environment
pvm info # pvm ini info
# Display active PHP version
pvm current
# List installed PHP versions
pvm list # pvm ls
# List installable PHP versions from remote source
pvm list available # pvm ls available
# Install a specific version.
pvm install <version> # pvm i <version>
# Uninstall a specific version
pvm uninstall <version> # pvm rm <version>
# Switch to use the specified version
pvm use <version>
# Switch to use the detected PHP version from .php-version or composer.json in your current project/directory
pvm use auto# Check status of multiple extensions
pvm ini status xdebug opcache
# Enable or disable multiple extensions
pvm ini enable xdebug opcache
pvm ini disable xdebug opcache
# Set or Get multiple settings values
pvm ini set memory_limit=512M max_file_uploads=20
pvm ini get memory_limit max_file_uploads
# Restore backup
pvm ini restore
# Check logs
pvm log --pageSize=[number] # Default value is 5Run tests against the PowerShell scripts in the repo — especially useful for contributors verifying changes before submitting a pull request:
To run tests with, you need to have the Pester testing framework installed. Pester is a testing framework for PowerShell.
Open PowerShell as Administrator and run:
Install-Module -Name Pester -Force -SkipPublisherCheck💡 If prompted to trust the repository, type Y and press Enter.
You can verify the installation with:
Get-Module -ListAvailable Pesterpvm test [files = (files inside the tests/ directory)] [--coverage] [--verbosity=(None|Normal|Detailed|Diagnostic)] [--tag=yourTag]
# Examples:
pvm test # Runs all tests with Normal (default) verbosity.
pvm test use install # Runs only use.tests.ps1 and install.tests.ps1 with Normal verbosity.
pvm test --verbosity=Detailed --coverage # Runs all tests with Detailed verbosity and generates coverage report.
pvm test helpers list --verbosity=Diagnostic --tag=myTag # Runs helpers.tests.ps1 and list.tests.ps1 with Diagnostic verbosity and only runs tests with tag "myTag".Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.