Instantly share code, notes, and snippets.

anonymous /provisioner-php5.5.sh
Created Nov 20, 2016

Embed
What would you like to do?
Scotch Box Change PHP Repository
#!/usr/bin/env bash
# Update PHP Repo
sudo rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get -y update
# Remove PHP 5.6
sudo apt-get --remove purge -y php5 php5-cli php5-curl php5-gd php5-intl php5-mcrypt php5-memcached php5-mysqlnd php5-readline php5-sqlite php5-cgi php5-common php5-fpm php5-imagick php5-json php5-memcache php5-mongo php5-pgsql php5-redis php-pear
sudo apt-get -y autoremove
# Install PHP 5.5
sudo apt-get -y install php5 php5-common php5-cgi php5-fpm php5-pgsql php5-cli php5-json php5-curl php5-mcrypt php5-gd php5-intl php5-mysql php5-readline php5-memcached php5-memcache php5-imagick php5-xdebug php5-redis php5-mongo php5.5-mbstring php5.5-sqlite3 php5.5-zip php5.5-xml php5.5-opcache
sudo apt-get -y install libapache2-mod-php5.5
sudo service apache2 restart
# Remove MySQL
sudo service mysql stop
sudo apt-get remove --purge -y mysql-server
sudo apt-get -y autoremove
# Install MariaDB
sudo apt-get -y install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository -y 'deb [arch=amd64,i386,ppc64el] http://mirror.ufscar.br/mariadb/repo/10.1/ubuntu trusty main'
sudo apt-get -y update
export DEBIAN_FRONTEND=noninteractive
sudo debconf-set-selections <<< 'mariadb-server-10.1 mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mariadb-server-10.1 mysql-server/root_password_again password root'
sudo apt-get install -y mariadb-server
sudo service mysql restart
# Allow ROOT access
sudo sed -i "s/bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
sudo echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION" | mysql -u root --password=root
sudo echo "GRANT PROXY ON ''@'' TO 'root'@'%' WITH GRANT OPTION" | mysql -u root --password=root
sudo service mysql restart
# We Are Champions My Friend!!!
#!/usr/bin/env bash
# Update PHP Repo
sudo rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get -y update
# Remove PHP 5.6
sudo apt-get --remove purge -y php5 php5-cli php5-curl php5-gd php5-intl php5-mcrypt php5-memcached php5-mysqlnd php5-readline php5-sqlite php5-cgi php5-common php5-fpm php5-imagick php5-json php5-memcache php5-mongo php5-pgsql php5-redis php-pear
sudo apt-get -y autoremove
# Install PHP 7.0
sudo apt-get -y install php7.0 php7.0-common php7.0-cgi php7.0-fpm php7.0-pgsql php7.0-cli php7.0-json php7.0-curl php7.0-mcrypt php7.0-gd php7.0-intl php7.0-mysql php7.0-readline php7.0-mbstring php7.0-sqlite3 php7.0-zip php7.0-xml php7.0-opcache php-memcached php-mongodb php-memcache php-imagick php-xdebug php-redis
sudo apt-get -y install libapache2-mod-php7.0
sudo service apache2 restart
# Remove MySQL
sudo service mysql stop
sudo apt-get remove --purge -y mysql-server
sudo apt-get -y autoremove
# Install MariaDB
sudo apt-get -y install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository -y 'deb [arch=amd64,i386,ppc64el] http://mirror.ufscar.br/mariadb/repo/10.1/ubuntu trusty main'
sudo apt-get -y update
export DEBIAN_FRONTEND=noninteractive
sudo debconf-set-selections <<< 'mariadb-server-10.1 mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mariadb-server-10.1 mysql-server/root_password_again password root'
sudo apt-get install -y mariadb-server
sudo service mysql restart
# Permitir ROOT em todos os hosts
sudo sed -i "s/bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
sudo echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION" | mysql -u root --password=root
sudo echo "GRANT PROXY ON ''@'' TO 'root'@'%' WITH GRANT OPTION" | mysql -u root --password=root
sudo service mysql restart
# We Are Champions My Friend!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment