Skip to content

Instantly share code, notes, and snippets.

@Baptouuuu
Last active September 30, 2018 12:44
Show Gist options
  • Select an option

  • Save Baptouuuu/4e0729f2f06af53e6df047cf660ae4f5 to your computer and use it in GitHub Desktop.

Select an option

Save Baptouuuu/4e0729f2f06af53e6df047cf660ae4f5 to your computer and use it in GitHub Desktop.
Bootstrap php
#!/usr/bin/env bash
# install php 7.2
apt-get install apt-transport-https lsb-release ca-certificates -y
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
apt-get update
apt-get install git php7.2 php7.2-fpm php7.2-cli php7.2-json php7.2-xml php7.2-intl php7.2-mbstring php7.2-curl php7.2-zip php7.2-gd php7.2-bcmath -y
# install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# hash can't be verified automatically
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/bin/composer
echo 'export PATH=~/.composer/vendor/bin:$PATH' >> ~/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment