You are here

upgrading phpMyAdmin

Recent exploits that use phpMyAdmin highlight the need to keep this code up to date. For more info, see:
http://seclists.org/fulldisclosure/2011/Oct/690
http://www.dslreports.com/forum/r24640843-Botnet-Trend-phpMyAdmin-SSH-At...

#first set up the basic info.
#find latest version here: http://sourceforge.net/projects/phpmyadmin/files/
#pma directory--could be: mydir=/usr/share
# using ln -sfn /usr/share/phpmyadmin/ /var/www/html/phpMyAdmin

mydir=/var/www/html  
phpMyAdmin=phpMyAdmin  #could be: phpMyAdmin=phpmyadmin
version="3.5.1"
#test with:
ls $mydir/$phpMyAdmin/config.inc.php

#now do the install (you may want to run this one line at a time

cp -a $mydir/$phpMyAdmin/config.inc.php ~
wget -O - "http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/$version/phpMyAdmin-$version-english.tar.bz2"  | tar xj -C $mydir
mv $mydir/$phpMyAdmin $mydir/$phpMyAdmin-old
mv $mydir/phpMyAdmin-$version-english $mydir/$phpMyAdmin
cp -a ~/config.inc.php $mydir/$phpMyAdmin

#once you have tested it, then the old version can be deleted:

rm -Rf $mydir/$phpMyAdmin-old

#If the program needs to be setup:

cd $mydir/$phpMyAdmin
mkdir config                  # create directory for saving
chmod o+rw config             # give it world writable permissions

#visit the /setup page


mv config/config.inc.php .    # move file to current directory
chmod o-rw config.inc.php     # remove world read and write permissions
rm -rf config                 # remove not needed directory
Topic: