From 83b5da2837cff371f377d0e6789ec34a26b6a11c Mon Sep 17 00:00:00 2001 From: Puleeno Nguyen Date: Sun, 28 Nov 2021 01:51:57 +0700 Subject: [PATCH] Fix Bad Substitution error on Debian --- config | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config b/config index 698a6a57..e56ff3d6 100644 --- a/config +++ b/config @@ -66,10 +66,9 @@ fi if [ -z "$NGX_PHP_LIBS" ]; then PHP_VERSION="`$PHP_CONFIG --version`" - if [ ${PHP_VERSION:0:1} -ge "8" ]; then + PHP_MAJOR_VERSION=`echo $PHP_VERSION | sed -e "s#\.[0-9]*##g"` + if [ $PHP_MAJOR_VERSION -ge "8" ]; then PHP_MAJOR_VERSION="" - else - PHP_MAJOR_VERSION=${PHP_VERSION:0:1} fi NGX_PHP_LIBS="`$PHP_CONFIG --ldflags` `$PHP_CONFIG --libs` -L$PHP_LIB -lphp$PHP_MAJOR_VERSION " fi @@ -91,4 +90,4 @@ else CORE_LIBS="$CORE_LIBS $NGX_PHP_LIBS " fi -have=NDK_SET_VAR . auto/have \ No newline at end of file +have=NDK_SET_VAR . auto/have