Skip to content

Instantly share code, notes, and snippets.

@nicooga
Last active August 13, 2016 22:35
Show Gist options
  • Save nicooga/0412767048fbdb4953fd76f88bce7825 to your computer and use it in GitHub Desktop.
Save nicooga/0412767048fbdb4953fd76f88bce7825 to your computer and use it in GitHub Desktop.
An script for installing latest version of php via phpenv and phpbuild.

Usage

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment