Skip to content

Instantly share code, notes, and snippets.

@abr4xas
Last active April 2, 2020 12:49
Show Gist options
  • Save abr4xas/0b3c6998d22348138da173efbede241e to your computer and use it in GitHub Desktop.
Save abr4xas/0b3c6998d22348138da173efbede241e to your computer and use it in GitHub Desktop.
Script para instalar php 7.2
#!/usr/bin/env bash
# Script para instalar PHP7 MYSQL
# Developed by abr4xas <me@abr4xas.org>
if [[ $USER != root ]]; then
echo "##########################################"
echo "# Error: Debe tener privilegios de ROOT ##"
echo "##########################################"
exit 1
fi
set -eu
PASSWORD='root'
export DEBIAN_FRONTEND=noninteractive
add-apt-repository ppa:ondrej/php -y > /dev/null 2>&1
apt-get update --fix-missing > /dev/null 2>&1
apt-get install php7.2 php7.2-fpm php7.2-gd php7.2-mysql php7.2-cli php7.2-common php7.2-curl php7.2-opcache php7.2-json php-common php7.2-readline php7.2-mbstring php7.2-xml php7.2-zip php7.2-soap php7.2-bcmath php7.2-sqlite3 php-imagick -y > /dev/null 2>&1
phpenmod mbstring
debconf-set-selections <<< "mysql-server mysql-server/root_password password $PASSWORD" > /dev/null 2>&1
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $PASSWORD" > /dev/null 2>&1
apt-get install mysql-server -y
echo -e "\e[00;1;92mFinished...\e[00m"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment