Forrest logo
back to the phpenv tool

phpenv:tldr:d57a8

phpenv: Set the local PHP version, which overrides the global version.
$ phpenv local ${version}
try on your machine

The command phpenv local ${version} is used to set the local PHP version in a project using phpenv.

phpenv is a command-line tool used for managing multiple PHP versions on a single machine. It allows you to easily switch between different versions of PHP based on your project's requirements.

The local command is used to set the PHP version locally for a specific project. By running phpenv local ${version}, you are specifying the PHP version you want to use for that project.

${version} is a placeholder that should be replaced with the actual version number you want to use. For example, if you want to set the PHP version to 7.4, the command would be phpenv local 7.4.

After running the command, phpenv will create a .php-version file in the current directory, which will contain the specified version number. When you navigate to that project directory, phpenv will detect the .php-version file and automatically switch to the specified PHP version for that project.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the phpenv tool