Skip to content

Instantly share code, notes, and snippets.

@hasibomi
Created February 1, 2018 07:55
Show Gist options
  • Save hasibomi/e44ccfffc330139b1159f10ab9e56b38 to your computer and use it in GitHub Desktop.
Save hasibomi/e44ccfffc330139b1159f10ab9e56b38 to your computer and use it in GitHub Desktop.
Upgrade from PHP 5.X.X to PHP 7.1 on an AWS EC2 Linux Server. Inspired by https://gist.github.com/mavieth/b6b3b622dd9f863ca2c7db2da04ab215
#!/bin/bash
echo "==============================="
echo "Installing PHP 7.1"
echo "==============================="
sudo yum install php71
echo "==============================="
echo "Installing PHP 7.1 additional commonly used php packages"
echo "==============================="
sudo yum install php71-gd
sudo yum install php71-imap
sudo yum install php71-mbstring
sudo yum install php71-mysqlnd
sudo yum install php71-opcache
sudo yum install php71-pecl-apcu
echo "==============================="
echo "Linking PHP 7.1"
echo "==============================="
sudo ln -sf /etc/httpd/conf.d/php-conf.7.1 /etc/alternatives/php.conf
sudo ln -sf /etc/httpd/conf.modules.d/15-php-conf.7.1 /etc/alternatives/10-php.conf
echo "==============================="
echo "Choose PHP 7.1 as an Alternative"
echo "==============================="
sudo alternatives --config php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment