An script for installing latest version of php via phpenv and phpbuild.
curl https://gist.githubusercontent.com/nicooga/0412767048fbdb4953fd76f88bce7825/raw/install_php.sh | bash
# Installl phpenv and phpbuild in a single step | |
# https://github.com/rogeriopradoj/phpenv-installer | |
curl -L http://git.io/phpenv-installer | bash | |
# Add this to ~/.bashrc to enable phpenv each time you fire up a terminal | |
cat <<EOT >> ~/.bashrc | |
export PHPENV_ROOT="${HOME}/.phpenv" | |
export PATH="${PHPENV_ROOT}/bin:${PATH}" | |
eval "$(phpenv init -)" | |
EOT | |
source ~/.bashrc | |
# Get packages needed for compiling php | |
sudo apt-get install -y \ | |
libxml2-dev \ | |
libcurl4-gnutls-dev \ | |
libjpeg-dev \ | |
libpng12-dev \ | |
libmcrypt-dev \ | |
libtidy-dev \ | |
libxslt1-dev \ | |
autoconf | |
# Seal the deal | |
phpenv install 7.0.9 |