Hi.
I am trying to switch PHP version to 7.3.19, but got the error "tar: php-7.3.19.tar.gz: Cannot open: No such file or directory". Found the error in script /usr/local/src/php-rebuild.sh:
# PHP Sources
PHPDOWNLOADVERCWP=`wget -q -S --spider "http://dl1.centos-webpanel.com/files/php/php-$version.tar.gz" -O - 2>&1 | sed -ne '/Content-Length/{s/.*: //;p}'`
PHPDOWNLOADVERMUSEUM=`wget -q -S --spider "https://museum.php.net/php$majorversion/php-$version.tar.gz" -O - 2>&1 | sed -ne '/Content-Length/{s/.*: //;p}'`
# Check if on CWP source file exist (redirect gives code 200 always)
if [ -z "$PHPDOWNLOADVERCWP" ];then
PHPDOWNLOADVERCWP=0
fi
# Check if file size is over 8MB
if [ $PHPDOWNLOADVERCWP -ge 8000000 ];then
phpsource="http://dl1.centos-webpanel.com/files/php/php-$version.tar.gz"
elif [ $PHPDOWNLOADVERMUSEUM -ge 8000000 ];then
phpsource="https://museum.php.net/php5/php-$version.tar.gz"
else
echo "Failed to Download PHP version $version!"
exit 1
fi
The file php-7.3.19.tar.gz is tested for the size of 8MB. Since it is bigger then 8MB, the secondary link is used. But there is a problem: to download file from secondary link, the link is for php5 fixed in the code. Should be a variable $majorversion in there.
The script is ganerated automatic. How can I fix that?