Getting started
Install pv
Section titled “Install pv”curl -fsSL https://raw.githubusercontent.com/adrum/pv/main/install.sh | shThe script downloads the build for your platform, verifies it against the
published sha256, and puts pv in ~/.local/bin (override with PV_BIN_DIR).
It does not touch your shell profile — that line is yours to paste, below.
From source instead:
cargo build --releaseinstall -m 0755 target/release/pv /usr/local/bin/pvGet a PHP
Section titled “Get a PHP”pv install 8.4 # newest 8.4.xpv install 8.4.3 # exactly this onepv install latest # newest publishedPut the shims on PATH
Section titled “Put the shims on PATH”eval "$(pv init zsh)" # or bash, sh, fishAdd that to your shell profile. It prepends pv’s shim directory, which
matters: a shim directory placed after /usr/bin or a package manager’s prefix
is silently shadowed by whatever PHP is already there.
Then open a new shell — or run hash -r, because shells cache command
locations and yours may still remember a php from before pv existed.
pv doctorDoctor confirms it worked and says plainly what to fix when it did not.
Pin a version for a project
Section titled “Pin a version for a project”cd ~/code/legacy-apppv pin 7.4php -v # PHP 7.4.x, here and belowpv pin writes a .php-version file — a bare version string, one line.
Commit it, and everyone on the project gets the same runtime.
Run a tool under the resolved PHP
Section titled “Run a tool under the resolved PHP”pv run composer installYour Composer, the PHP this directory resolves to. pv does not ship Composer;
a composer.phar already works through the shims, and this is for the
package-manager wrappers that hardcode their own PHP.