From 42e7262e33af5c5ae4a7581be83cd3f998638372 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 17 Feb 2019 08:54:10 -0700 Subject: [PATCH] Update php.sh --- debian/resources/php.sh | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/debian/resources/php.sh b/debian/resources/php.sh index 53707db..eacfda5 100755 --- a/debian/resources/php.sh +++ b/debian/resources/php.sh @@ -11,12 +11,34 @@ cd "$(dirname "$0")" #send a message verbose "Configuring PHP" -#change the version of php for debian stretch -if [ ."$os_codename" = ."stretch" ]; then - if [ ."$cpu_architecture" = ."arm" ]; then - php_version=7.2 - fi +#add the repos +if [ ."$os_name" = ."Ubuntu" ]; then + #16.10.x - */yakkety/ + #16.04.x - */xenial/ + #14.04.x - */trusty/ + if [ ."$os_codename" = ."trusty" ]; then + which add-apt-repository || apt-get install -y software-properties-common + LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php + fi +elif [ ."$cpu_architecture" = ."arm" ]; then + #Pi2 and Pi3 Raspbian + #Odroid + if [ ."$os_codename" = ."stretch" ]; then + php_version=7.2 + else + php_version=5.6 + fi + apt-get -y install apt-transport-https lsb-release ca-certificates + wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg + sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' +else + #9.x - */stretch/ + #8.x - */jessie/ + apt-get -y install apt-transport-https lsb-release ca-certificates + wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg + sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' fi +apt-get update -y #install dependencies apt-get install -y nginx