Update install.sh

pull/205/head
midoks 3 years ago
parent 7b09776392
commit 76c655872b
  1. 20
      plugins/php/versions/81/install.sh

@ -61,6 +61,24 @@ if version_lt "$libzip_version" "0.11.0" ;then
ZIP_OPTION="--with-zip=$serverPath/lib/libzip"
fi
# ----- cpu start ------
if [ -z "${cpuCore}" ]; then
cpuCore="1"
fi
if [ -f /proc/cpuinfo ];then
cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l`
fi
MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}')
if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then
if [ "${cpuCore}" -gt "${MEM_INFO}" ];then
cpuCore="${MEM_INFO}"
fi
else
cpuCore="1"
fi
# ----- cpu end ------
echo "$sourcePath/php/php${PHP_VER}"
@ -89,7 +107,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make && make install && make clean
make clean && make -j${cpuCore} && make install && make clean
fi
#------------------------ install end ------------------------------------#
}

Loading…
Cancel
Save