瀏覽代碼

fix: get latest php version from www.php.net

Cat 2 年之前
父節點
當前提交
72e0612013
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/upgrade_php.sh

+ 1 - 1
include/upgrade_php.sh

@@ -12,7 +12,7 @@ Upgrade_PHP() {
   pushd ${oneinstack_dir}/src > /dev/null
   [ ! -e "${php_install_dir}" ] && echo "${CWARNING}PHP is not installed on your system! ${CEND}" && exit 1
   OLD_php_ver=`${php_install_dir}/bin/php-config --version`
-  Latest_php_ver=`curl --connect-timeout 2 -m 3 -s http://php.net/downloads.php | awk '/Changelog/{print $2}' | grep "${OLD_php_ver%.*}"`
+  Latest_php_ver=`curl --connect-timeout 2 -m 3 -s https://www.php.net/releases/active.php | python -mjson.tool | awk '/version/{print $2}' | sed 's/"//g' | grep "${OLD_php_ver%.*}"`
   Latest_php_ver=${Latest_php_ver:-5.5.38}
   echo
   echo "Current PHP Version: ${CMSG}$OLD_php_ver${CEND}"