From bad2958744043c0f382eb08f7b8f951467fc007b Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 4 Jul 2022 21:19:29 +0200 Subject: [PATCH] mod_php_install.sh: some changes in script output. --- mod_php_install.sh | 129 ++++++++++++++++++++++++++------------------- 1 file changed, 75 insertions(+), 54 deletions(-) diff --git a/mod_php_install.sh b/mod_php_install.sh index 7c3da6b..248916d 100755 --- a/mod_php_install.sh +++ b/mod_php_install.sh @@ -2510,7 +2510,7 @@ fi #cp php.ini-production $PHP_INI_FILE || exit 1 -[ -f $PHP_INI_FILE ] && cp -a $PHP_INI_FILE ${$PHP_INI_FILE}-$_backup_date +[[ -f $PHP_INI_FILE ]] && cp -a $PHP_INI_FILE ${PHP_INI_FILE}-$_backup_date cp php.ini-production $PHP_INI_FILE || exit 1 ## - Temporarily change PATH environment variable @@ -2519,15 +2519,28 @@ export PATH=/usr/local/php-${VERSION}/bin:$PATH if ! $WITHOUT_APACHE_MOD_PHP ; then - _set_php_entries="" - echo "" - echo -n "do you want to set \"LoadModule\" entries in httpd.conf ? [y/n]: " - read _set_php_entries - if [ "y" = "$_set_php_entries" -o "Y" = "$_set_php_entries" -o "Yes" = "$_set_php_entries" -o "yes" = "$_set_php_entries" ];then - sed -i -r \ - -e "s&(^\s*LoadModule php${PHP_MAJOR_VERSION}_module.*$)&\1\n\n AddType application/x-httpd-php .php\n AddType application/x-httpd-php-source .phps\n&" ${APACHE_BASEDIR}/conf/httpd.conf - #-e "s&(^\s*LoadModule php${PHP_MAJOR_VERSION}_module.*$)&\1\n\n AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml\n AddType application/x-httpd-php-source .phps\n&" ${APACHE_BASEDIR}/conf/httpd.conf + + #_set_php_entries="" + #echo "" + #echo -n "do you want to set \"LoadModule\" entries in httpd.conf ? [y/n]: " + #read _set_php_entries + #if [ "y" = "$_set_php_entries" -o "Y" = "$_set_php_entries" -o "Yes" = "$_set_php_entries" -o "yes" = "$_set_php_entries" ];then + # + # sed -i -r \ + # -e "s&(^\s*LoadModule php${PHP_MAJOR_VERSION}_module.*$)&\1\n\n AddType application/x-httpd-php .php\n AddType application/x-httpd-php-source .phps\n&" ${APACHE_BASEDIR}/conf/httpd.conf + # + # + #fi + + echononl "\tGoing to set \"LoadModule\" entries in httpd.conf .." + sed -i -r \ + -e "s&(^\s*LoadModule php${PHP_MAJOR_VERSION}_module.*$)&\1\n\n AddType application/x-httpd-php .php\n AddType application/x-httpd-php-source .phps\n&" ${APACHE_BASEDIR}/conf/httpd.conf + if [ "$?" = "0" ]; then + echo_ok + else + echo_failed fi + fi echo "" @@ -4691,19 +4704,21 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -ge 4 ]]) \ echo_ok else echo_failed - cho "" - echo "" - echononl "continue anyway [yes/no]: " - read OK - OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" - while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do - echononl "Wrong entry! - repeat [yes/nno]: " - read OK - done - [[ $OK = "yes" ]] || fatal "Abbruch durch User" - echo "" - failed=true + error "For more details see '${_logdir}/pecl_install.log'.. " + + #echo "" + #echononl "continue anyway [yes/no]: " + #read OK + #OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + #while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + # echononl "Wrong entry! - repeat [yes/nno]: " + # read OK + #done + #[[ $OK = "yes" ]] || fatal "Abbruch durch User" + #echo "" + + _failed=true fi fi if ! $_failed ; then @@ -4719,18 +4734,20 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -ge 4 ]]) \ else echo_failed - echo "" - echononl "continue anyway [yes/no]: " - read OK - OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" - while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do - echononl "Wrong entry! - repeat [yes/nno]: " - read OK - done - [[ $OK = "yes" ]] || fatal "Abbruch durch User" - echo "" + error "For more details see '${_logdir}/pecl_install.log'.. " - failed=true + #echo "" + #echononl "continue anyway [yes/no]: " + #read OK + #OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + #while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + # echononl "Wrong entry! - repeat [yes/nno]: " + # read OK + #done + #[[ $OK = "yes" ]] || fatal "Abbruch durch User" + #echo "" + + _failed=true fi fi if ! $_failed ; then @@ -4746,18 +4763,20 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -ge 4 ]]) \ else echo_failed - echo "" - echononl "continue anyway [yes/no]: " - read OK - OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" - while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do - echononl "Wrong entry! - repeat [yes/nno]: " - read OK - done - [[ $OK = "yes" ]] || fatal "Abbruch durch User" - echo "" + error "For more details see '${_logdir}/pecl_install.log'.. " - failed=true + #echo "" + #echononl "continue anyway [yes/no]: " + #read OK + #OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + #while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + # echononl "Wrong entry! - repeat [yes/nno]: " + # read OK + #done + #[[ $OK = "yes" ]] || fatal "Abbruch durch User" + #echo "" + + _failed=true fi fi if ! $_failed ; then @@ -4773,18 +4792,20 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -ge 4 ]]) \ else echo_failed - echo "" - echononl "continue anyway [yes/no]: " - read OK - OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" - while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do - echononl "Wrong entry! - repeat [yes/nno]: " - read OK - done - [[ $OK = "yes" ]] || fatal "Abbruch durch User" - echo "" + error "For more details see '${_logdir}/pecl_install.log'.. " - failed=true + #echo "" + #echononl "continue anyway [yes/no]: " + #read OK + #OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + #while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + # echononl "Wrong entry! - repeat [yes/nno]: " + # read OK + #done + #[[ $OK = "yes" ]] || fatal "Abbruch durch User" + #echo "" + + _failed=true fi fi rm -rf /tmp/pecl-text-wddx