From 7fb294db13c121f03cc96dd421f2b64f1064c8ad Mon Sep 17 00:00:00 2001 From: Teddysun Date: Thu, 22 Dec 2016 11:19:11 +0900 Subject: [PATCH] update PHP 7.1 support --- include/upgrade_php.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/upgrade_php.sh b/include/upgrade_php.sh index 89b81a3..f2cf233 100644 --- a/include/upgrade_php.sh +++ b/include/upgrade_php.sh @@ -26,6 +26,8 @@ upgrade_php(){ latest_php=$(curl -s http://php.net/downloads.php | awk '/Changelog/{print $2}' | grep '5.6') elif [ "${php_version}" == "7.0" ];then latest_php=$(curl -s http://php.net/downloads.php | awk '/Changelog/{print $2}' | grep '7.0') + elif [ "${php_version}" == "7.1" ];then + latest_php=$(curl -s http://php.net/downloads.php | awk '/Changelog/{print $2}' | grep '7.1') fi echo -e "Latest version of PHP: \033[41;37m ${latest_php} \033[0m" @@ -84,19 +86,19 @@ upgrade_php(){ with_mysql="" if [ -d ${mariadb_location} ]; then - if [ "${php_version}" == "7.0" ];then + if [[ "${php_version}" == "7.0" || "${php_version}" == "7.1" ]]; then with_mysql="--with-mysqli=${mariadb_location}/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock" else with_mysql="--with-mysql=${mariadb_location} --with-mysqli=${mariadb_location}/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock" fi elif [ -d ${mysql_location} ]; then - if [ "${php_version}" == "7.0" ];then + if [[ "${php_version}" == "7.0" || "${php_version}" == "7.1" ]]; then with_mysql="--with-mysqli=${mysql_location}/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock" else with_mysql="--with-mysql=${mysql_location} --with-mysqli=${mysql_location}/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock" fi elif [ -d ${percona_location} ]; then - if [ "${php_version}" == "7.0" ];then + if [[ "${php_version}" == "7.0" || "${php_version}" == "7.1" ]]; then with_mysql="--with-mysqli=${percona_location}/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock" else with_mysql="--with-mysql=${percona_location} --with-mysqli=${percona_location}/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock" @@ -104,14 +106,11 @@ upgrade_php(){ fi enable_opcache="" - if [[ "${php_version}" == "5.5" || "${php_version}" == "5.6" || "${php_version}" == "7.0" ]]; then - enable_opcache="--enable-opcache" - fi - with_gmp="--with-gmp" with_icu_dir="--with-icu-dir=/usr" - if centosversion 5; then - if [[ "${php_version}" == "5.5" || "${php_version}" == "5.6" || "${php_version}" == "7.0" ]];then + if [[ "${php_version}" == "5.5" || "${php_version}" == "5.6" || "${php_version}" == "7.0" || "${php_version}" == "7.1" ]]; then + enable_opcache="--enable-opcache" + if centosversion 5; then with_gmp="--with-gmp=/usr/local" with_icu_dir="--with-icu-dir=/usr/local" fi