加快php编译速度

pull/205/head
midoks 3 years ago
parent 81c7929240
commit 7fbe421b0c
  1. 20
      plugins/php/versions/53/install.sh
  2. 21
      plugins/php/versions/54/install.sh
  3. 21
      plugins/php/versions/55/install.sh
  4. 21
      plugins/php/versions/56/install.sh
  5. 21
      plugins/php/versions/71/install.sh
  6. 21
      plugins/php/versions/72/install.sh
  7. 21
      plugins/php/versions/73/install.sh
  8. 20
      plugins/php/versions/74/install.sh

@ -56,6 +56,24 @@ if [ "$IS_64BIT" == "64" ];then
OPTIONS="${OPTIONS} --with-libdir=lib64"
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 ------
if [ ! -d $serverPath/php/53/bin ];then
cd $sourcePath/php/php${PHP_VER} && ./configure \
@ -88,7 +106,7 @@ if [ ! -d $serverPath/php/53/bin ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make clean && make && make install && make clean
make clean && make -j${cpuCore} && make install && make clean
fi

@ -48,6 +48,25 @@ if [ "$IS_64BIT" == "64" ];then
OPTIONS="${OPTIONS} --with-libdir=lib64"
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 ------
if [ ! -d $serverPath/php/${PHP_VER} ];then
cd $sourcePath/php/php${PHP_VER} && ./configure \
@ -73,7 +92,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
$OPTIONS \
--enable-fpm
make clean && make
make clean && make -j${cpuCore}
#debian11,没有生成php54 man
if [ ! -f sapi/cli/php.1 ];then

@ -47,6 +47,25 @@ if [ "$IS_64BIT" == "64" ];then
OPTIONS="${OPTIONS} --with-libdir=lib64"
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 ------
if [ ! -d $serverPath/php/55 ];then
cd $sourcePath/php/php${PHP_VER} && ./configure \
--prefix=$serverPath/php/55 \
@ -71,7 +90,7 @@ if [ ! -d $serverPath/php/55 ];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 ------------------------------------#

@ -47,6 +47,25 @@ if [ "$IS_64BIT" == "64" ];then
OPTIONS="${OPTIONS} --with-libdir=lib64"
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 ------
if [ ! -d $serverPath/php/56 ];then
cd $sourcePath/php/php${PHP_VER} && ./configure \
@ -74,7 +93,7 @@ if [ ! -d $serverPath/php/56 ];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 ------------------------------------#

@ -44,6 +44,25 @@ if [ "$IS_64BIT" == "64" ];then
OPTIONS="${OPTIONS} --with-libdir=lib64"
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 ------
if [ ! -d $serverPath/php/71 ];then
cd $sourcePath/php/php${PHP_VER} && ./configure \
--prefix=$serverPath/php/71 \
@ -67,7 +86,7 @@ if [ ! -d $serverPath/php/71 ];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 ------------------------------------#

@ -46,6 +46,25 @@ if [ "$IS_64BIT" == "64" ];then
OPTIONS="${OPTIONS} --with-libdir=lib64"
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 ------
if [ ! -d $serverPath/php/72 ];then
cd $sourcePath/php/php${PHP_VER} && ./configure \
--prefix=$serverPath/php/72 \
@ -69,7 +88,7 @@ if [ ! -d $serverPath/php/72 ];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 ------------------------------------#

@ -60,6 +60,25 @@ if version_lt "$libzip_version" "0.11.0" ;then
ZIP_OPTION="--with-libzip=$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 ------
if [ ! -d $serverPath/php/73 ];then
cd $sourcePath/php/php${PHP_VER} && ./configure \
--prefix=$serverPath/php/73 \
@ -83,7 +102,7 @@ if [ ! -d $serverPath/php/73 ];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 ------------------------------------#

@ -76,6 +76,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 ------
if [ ! -d $serverPath/php/${PHP_VER} ];then
cd $sourcePath/php/php${PHP_VER} && make clean
@ -102,7 +120,7 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
--disable-fileinfo \
$OPTIONS \
--enable-fpm
make && make install && make clean
make clean && make -j${cpuCore} && make install && make clean
fi
#------------------------ install end ------------------------------------#
}

Loading…
Cancel
Save