Manages PHP versions for command line. Works with zsh autocomplete.
Clone this repository anywhere on you computer and add source path/to/pvm/pvm.sh
to your zsh config file (~/.zshrc
in most cases).
pvm list
Show installed PHP versionspvm use 8.1.0
Switch current PHP binary versionpvm 8.1.0
Run specific PHP versionpvm 8.1.0 file.php
Run file with specific PHP versionpvm 8.1.0 -r "echo time()"
Run script from string with specific PHP versionpvm 8.1.0 -S 0.0.0.0:8080
Start PHP 8.1.0 server on port 8080- and so on...
> php -v
PHP 7.4.21
> pvm use 8.1.0
Using PHP 8.1.0 version.
> php -v
PHP 8.1.0