Hello there,
I've an issue on my VPS. The CWP is actually forcing an old version of phpMyAdmin as long as I'm daily updating the version.
I tried with a partial solution, by editing the scripts/mysql_phpmyadmin_update
From:
#!/bin/bash
current_version=`cat /usr/local/cwpsrv/var/services/pma/README | grep Version | cut -d " " -f 2`
cwp_latest=`curl -Ss "http://static.cdn-cwp.com/files/mysql/pma.txt"`
if [ "$current_version" != "$cwp_latest" ];then
echo "Updating phpMyAdmin from ${current_version} to version ${cwp_latest}"
Date=`date "+%d-%m-%Y"`
if [ -e "/usr/local/cwpsrv/var/services/pma" ];then
mv /usr/local/cwpsrv/var/services/pma /usr/local/cwpsrv/var/services/pma_$Date.bak
fi
cd /usr/local/cwpsrv/var/services/
wget http://static.cdn-cwp.com/files/mysql/phpMyAdmin-${cwp_latest}-all-languages.zip
unzip -o -q phpMyAdmin-${cwp_latest}-all-languages.zip
rm -f phpMyAdmin-${cwp_latest}-all-languages.zip
mv phpMyAdmin-${cwp_latest}-all-languages pma
chown -R cwpsvc:cwpsvc pma
rm -rf /usr/local/cwpsrv/var/services/pma/setup
mv /usr/local/cwpsrv/var/services/pma/config.sample.inc.php /usr/local/cwpsrv/var/services/pma/config.inc.php
ran_password=$(</dev/urandom tr -dc A-Za-z0-9 | head -c32)
sed -i "s|\['blowfish_secret'\] = ''|\['blowfish_secret'\] = '${ran_password}'|" /usr/local/cwpsrv/var/services/pma/config.inc.php
new_version=`cat /usr/local/cwpsrv/var/services/pma/README | grep Version | cut -d " " -f 2`
echo "phpMyAdmin Update, new version ${new_version}"
else
echo "You have the latest PMA version recommended by CWP!"
fi
To:
#!/bin/bash
current_version=`cat /usr/local/cwpsrv/var/services/pma/README | grep Version | cut -d " " -f 2`
cwp_latest=`curl -Ss "https://www.phpmyadmin.net/home_page/version.txt"`
readarray -t official_latest <<<"$cwp_latest"
real_version=${official_latest[0]}
real_url=${official_latest[2]}
if [ "$current_version" != "$real_version" ];then
echo "Updating phpMyAdmin from ${current_version} to version ${real_version}"
Date=`date "+%d-%m-%Y"`
if [ -e "/usr/local/cwpsrv/var/services/pma" ];then
mv /usr/local/cwpsrv/var/services/pma /usr/local/cwpsrv/var/services/pma_$Date.bak
fi
cd /usr/local/cwpsrv/var/services/
wget ${real_url}
unzip -o -q phpMyAdmin-${real_version}-all-languages.zip
rm -f phpMyAdmin-${real_version}-all-languages.zip
mv phpMyAdmin-${real_version}-all-languages pma
chown -R cwpsvc:cwpsvc pma
rm -rf /usr/local/cwpsrv/var/services/pma/setup
mv /usr/local/cwpsrv/var/services/pma/config.sample.inc.php /usr/local/cwpsrv/var/services/pma/config.inc.php
ran_password=$(</dev/urandom tr -dc A-Za-z0-9 | head -c32)
sed -i "s|\['blowfish_secret'\] = ''|\['blowfish_secret'\] = '${ran_password}'|" /usr/local/cwpsrv/var/services/pma/config.inc.php
new_version=`cat /usr/local/cwpsrv/var/services/pma/README | grep Version | cut -d " " -f 2`
echo "phpMyAdmin Update, new version ${new_version}"
else
echo "You have the latest PMA version recommended by phpMyAdmin for CWP!"
fi
This last one will automatically update the latest stable phpMyAdmin version but, during the night, this script will be restored to the old one, downgrading my phpMyAdmin version.
Can i fix this? How to?
Thanks and best regards.