From 9fee810c9c88eb334ac1407a9e696b36abb1bbfb Mon Sep 17 00:00:00 2001
From: Owain Jones <owanes@noc.ac.uk>
Date: Mon, 11 Apr 2016 09:31:48 +0000
Subject: [PATCH] update install script to install PHP7

---
 install.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/install.sh b/install.sh
index 1d8e8a8..c5beda4 100755
--- a/install.sh
+++ b/install.sh
@@ -13,6 +13,8 @@
 # As root:
 yum check-update -y
 yum install -y epel-release  # enables 'enterprise' software repo
+yum install yum-plugin-replace
+rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
 yum update -y 
 
 # Install needed tools
@@ -63,6 +65,18 @@ yum install -y MySQL-python python-sqlalchemy
 
 # Install PHP
 yum install -y php php-fpm php-apc php-pdo php-mcrypt php-mbstring php-pecl-runkit phpmyadmin
+
+# We install normal PHP *then* replace with php7 packages because phpmyadmin
+# wants original PHP, by replacing with php7 after the phpMA package doesn't
+# complain about wrong package versions.
+yum replace php-common --replace-with=php70w-common
+yum install php70w-fpm php70w-opcache php70w-devel php70w-pecl-apcu
+
+# Install "backwards compatability" extension for PHP-APC; our site and a bunch
+# of other stuff depends on it.
+pecl install "channel://pecl.php.net/apcu_bc-1.0.3"
+echo "extension=apc.so" >> /etc/php.d/apcu.ini
+
 cp php.ini /etc/php.ini
 cp php-d-fpm.ini /etc/php.d/fpm.ini
 cp php-fpm-www.conf /etc/php-fpm.d/www.conf
-- 
GitLab