Skip to content

Instantly share code, notes, and snippets.

@yevgnenll
Forked from mavieth/install-php-7.sh
Last active April 19, 2018 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yevgnenll/763d1b2a259067300e6679f443aaa316 to your computer and use it in GitHub Desktop.
Save yevgnenll/763d1b2a259067300e6679f443aaa316 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 php71
echo "==============================="
echo "Installing PHP 7 additional commonly used php packages"
echo "==============================="
sudo yum install php71-gd -y
sudo yum install php71-imap -y
sudo yum install php71-mbstring -y
sudo yum install php71-mysqlnd -y
sudo yum install php71-opcache -y
sudo yum install php71-pecl-apcu -y
echo "==============================="
echo "Linking PHP 7"
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 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