Author Topic: PHP Version Switcher  (Read 53857 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Re: PHP Version Switcher
« Reply #30 on: April 19, 2020, 08:31:03 PM »
centos still has some missing packages or has older packages not suitable for php 7.4 so running 7.4 would require customization so it's better to wait for it a little longer than to have other issues.
« Last Edit: April 19, 2020, 08:32:39 PM by studio4host »
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: PHP Version Switcher
« Reply #31 on: February 02, 2021, 05:11:00 PM »
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:

Code: [Select]

# 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?

Offline
*
Re: PHP Version Switcher
« Reply #32 on: February 02, 2021, 05:57:51 PM »
file is ~18MB so cwp download link must work, here is direct to test download on your server
http://dl1.centos-webpanel.com/files/php/php-7.3.19.tar.gz
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.