Skip to content

Instantly share code, notes, and snippets.

@doctortheisen
Forked from mavieth/install-php-7.sh
Created December 16, 2017 01:50
Show Gist options
  • Save doctortheisen/5958e7233ba7583dcafdf5582715959f to your computer and use it in GitHub Desktop.
Save doctortheisen/5958e7233ba7583dcafdf5582715959f to your computer and use it in GitHub Desktop.
Upgrade from PHP 5.X.X to PHP 7 on an AWS EC2 Linux Server
#!/bin/bash
echo "==============================="
echo "Installing PHP 7"
echo "==============================="
sudo yum install php70
echo "==============================="
echo "Installing PHP 7 additional commonly used php packages"
echo "==============================="
sudo yum install php70-gd
sudo yum install php70-imap
sudo yum install php70-mbstring
sudo yum install php70-mysqlnd
sudo yum install php70-opcache
sudo yum install php70-pecl-apcu
echo "==============================="
echo "Linking PHP 7"
echo "==============================="
sudo ln -sf /etc/httpd/conf.d/php-conf.7.0 /etc/alternatives/php.conf
sudo ln -sf /etc/httpd/conf.modules.d/15-php-conf.7.0 /etc/alternatives/10-php.conf
echo "==============================="
echo "Choose PHP 7 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