Install phpenv + php-build (and other plugins), updating all of them when you want to!
It's the standard way: phpenv-installer
idempotenttly installs or updates phpenv
in $HOME/.phpenv (default $PHPENV_ROOT value).
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer \
| bash
The script will then instruct you to edit your shell initialization files.
If you prefer to install phpenv
in other directory (i.e
$HOME/myphpenv
), or perhaps system-wide (i.e. /usr/local/bin/phpenv
),
it's easy: just set $PHPENV_ROOT before the installer command:
# $HOME/myphpenv
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer \
| PHPENV_ROOT=$HOME/myphpenv bash
# /usr/local/bin/phpenv
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer \
| PHPENV_ROOT=/usr/local/bin/phpenv bash
Note: depends on the path, you will need superuser (sudo) permission. You may also want to
sudo chown -R /usr/local/bin/phpenv
so that you can run the phpenv utilities as a regular user. Feel free to ask if you need some help!
phpenv update
- php-build/php-build: allows
phpenv install
- madumlao/phpenv-aliases: provides aliases for php versions
- ngyuki/phpenv-composer: automatically installs composer script for php version
rm -rf $(phpenv root)
You can verify the state of your phpenv installation with:
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-doctor \
| bash
Inspired by rbenv-installer and pyenv-installer