diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index 0523889bc..1f1a860e5 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -54,6 +54,16 @@ if [ ! -d $sourcePath/php/php${PHP_VER} ];then if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz fi + + #检测文件是否损坏. + md5_file_ok=0cbaae3de6c02cf8d7b82843fdfdf53d + if [ -f $sourcePath/php/php-${version}.tar.xz ];then + md5_file=`md5sum $sourcePath/php/php-${version}.tar.xz | awk '{print $1}'` + if [ "${md5_file}" != "${md5_file_ok}" ]; then + echo "PHP${version} 下载文件不完整,重新安装" + rm -rf $sourcePath/php/php-${version}.tar.xz + fi + fi cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz mv $sourcePath/php/php-${version} $sourcePath/php/php${PHP_VER}