Wednesday, May 12, 2010

HOWTO : phpmyadmin on Ubuntu 10.04 LTS Server

Since there is a bug in PHP5 on Ubuntu 10.04 LTS, the sessions are saved at /tmp instead of /var/lib/php5. Some PHP applications may not encountered any problem. However, phpmyadmin do run into problem - cannot login. Don't panic, I will show you how to solve this problem at ease.

Bug fix on PHP5

Do one of the following command depends on your situation.

sudo nano /etc/php5/cgi/php.ini

or

sudo nano /etc/php5/apache2/php.ini

or

sudo nano /etc/php5/cli/php.ini

Make the following changes to php.ini.

session.save_path = /tmp
session.auto_start = 1


Installation of phpmyadmin

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install phpmyadmin


Make sure mysql and php5 are already installed.

Configuration file of Apache2 and lighttp will be setup automatically after answering several questions. Write down what password you have entered.

sudo cp /usr/share/phpmyadmin/config.inc.php /usr/share/phpmyadmin/config.inc.php.bak

sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php

sudo nano /usr/share/phpmyadmin/config.inc.php

Locate $cfg['blowfish_secret']='' and enter some password like string, e.g. dlhw034tu034F&W.

The outcome will be :
$cfg['blowfish_secret']='dlhw034tu034F&W'

Save and then reboot your server. Or,

sudo /etc/init.d/php-fcgi restart
or
sudo /etc/init.d/php restart

Then, restart Apache or your web server
sudo /etc/init.d/apache2 restart

Access phpmyadmin with your browser and point the url to :
http://your_server_ip/phpmyadmin

username is "root" while the password is what you have entered during installation.

This bug has been reported by someone else. I think the fix will be released soon.

That's all! See you.