Clone the repo and add the directory to you Path variable.
git clone https://github.com/drissboumlik/pvm
cd pvmRun this command to setup pvm
pvm setupDisplay the avilable options
pvm helpDisplay active PHP version
pvm currentThis one lists the PHP installations. Type 'available' at the end to see what can be installed. Add -f or --force to load from the online source.
pvm list [available [-f]] # or --forceInstall a specific version.
- Add
--xdebugto enable xdebug - Add
--opcacheto enable opcache - Add
--dir=/absolute/path/to specify a custom installation directory
pvm install <version> [--xdebug] [--opcache] [--dir=/absolute/path/]Uninstall a specific version
pvm uninstall <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 autoEnable or disable PHP multiple extensions
pvm ini enable xdebug opcache
pvm ini disable xdebug opcacheSet or Get multiple settings values
pvm ini set memory_limit=512M max_file_uploads=20
pvm ini get memory_limit max_file_uploadsRestore backup
pvm ini restoreNote
Most of the commands edits or adds to the system environment variables, to reload the updates without restarting your terminal, you need to install chocolatey, and run refreshenv command
Run 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)] [verbosity = (None|Normal|Detailed|Diagnostic)]
# Examples:
pvm test # Runs all tests with Normal verbosity.
pvm test use install # Runs only use.tests.ps1 and install.tests.ps1 with Normal verbosity.
pvm test Detailed # Runs all tests with Detailed verbosity.
pvm test helpers list Diagnostic # Runs helpers.tests.ps1 and list.tests.ps1 with Diagnostic verbosity.