Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've isntalled phpmyadmin via apt-get.

I've set the apache env-vars to the correct user:group. I've set ownership of /etc/apache2 and /etc/phpmyadmin to this user:group. I've restarted both apache2 and mysql several times.

My Problem: When I access [ServerIP]/phpmyadmin I get the login screen, I enter the information, and i'm right back at the login screen, with not even an error "permission denied" or "password wrong" or whatever. The only things thats different is the URL: Instead of the Original


I am now at

http://[ServerIP]/phpmyadmin/index.php?token=[Long Hex string here]

However, still the login dialog.

My Question: How Do I fix this?


locked by HopelessN00b Apr 1 '15 at 18:49

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as off-topic by HopelessN00b Apr 1 '15 at 18:49

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

Check your PHP logs (/var/log/httpd/error.log, possibly) for errors. – Bill Weiss Feb 15 '10 at 3:16

15 Answers 15

Check your cookies. I think phpmyadmin uses cookies for auth. Either you are not accepting cookies, or phpmyadmin is setting the cookie with the wrong domain

have a look at your file you will probably want to set the 'host' setting to the same ip as you are using to access your server.

where can I find that file? I've looked but couldn't find it anywhere. – TMP Jan 5 '10 at 13:24
it should be in the same directory as phpmyadmin. It might be named, in which case rename it. Make sure to fill out $cfg['blowfish_secret'] if you don't have a file already. In fact, filling in (or changing) that value might fix your problem anyway. – yrosen Jul 27 '11 at 16:48

I seem to have encounted this problem quite a few times in the last couple weeks.

Usually when phpMyAdmin doesn't show ANY errors while trying to use the cookie-based login its either a SESSION or POST related problem. PHP kindly omits most session errors from the log file.

Check out the following:

  • Cookies (to store session id, it should remain the same value between requests)
  • Session Directory Exists
  • Session Directory Permissions (the user should have write access)
  • Session Directory Free Space
  • Session Directory otherwise unwritable (problematic network share/drive).
  • User Disk Quota Exceeded (common if the PHP user is not www-data)
  • Other File Storage errors (such as network shares)
  • Other Session Storage errors (for instance, if you're using a special session provider)
  • max_post_size too small (or too big, 2G max_post_size rolls over to negatives)
  • Web Server Configuration problem (preventing POST requests from getting to phpMyAdmin)

I've seen that happen if your PHP install doesn't include the "mcrypt" library. Check phpinfo() and see if you have an mcrypt section.

Do an "apt-get install php5-mcrypt" if its missing.


I have this happen to me a couple of times per month and it is super annoying - wiping out all the cookies pertaining to PMA has always done the trick. Depending on your browser, you should be able to find some instructions here:

I have firefox and have the web developer toolbar add-on and so I simply go to Cookies->Delete Domain Cookies


Maybe it was just that the server was briefly overloaded. Server was drawing considerable amount of resources. Try delete any unused file, example old backup data...


I had this problem too. If you used the setup wizard to configure your instance of phpMyAdmin, make sure your file is in the phpMyAdmin root dir, and not still in the config directory where the setup wizard put it...


I ran into the same issue. If you installed the mycrypt extension using apt-get php5-mycrypt you will need to manually enable it in the php.ini file.

It wasn't auto activated for me (Wasted a good hour on this).

To manually enable the extension just add

to the /etc/php5/apache2/php.ini file. This can either be done anywhere in the file.


The username and password being requested are most likely for the DB, not for anything apache related. Try a valid DB user and see if that gets you where you are trying to go.


After installing phpmyadmin via apt-get will work without modification and most dependencies will be satisfied. However, you may still have to install mysql:

apt-get install mysql5-server

If you want to connect to a remote mysql server you need to modify phpmyadmin's .php config file.

Another possibility is that you have cookies disabled or perhaps javascript is turned off, try using a default firefox.


Check /etc/phpmyadmin/ and verify all of your settings are correct.

  1. Either mcrypt is not installed or your connection to mySQL is off
  2. To ensure you can connect to mySQL, make sure the php.ini file has the correct mySQL socket
  3. Inside php.ini, look for mysql.default_socket = /tmp/mysql.sock
  4. the mysql.default_socket should be set to the location of your installed mysql socket
  5. For mac os x 10.6. and if you installed mySQL, the default location is /tmp/mysql.sock

I had the same issue and after going through all the PHPMyAdmin fixes nothing worked.

THEN ....

Noticed the disc was pretty full. Removed a bunch of stuff and POOF! PHPMyAdmin worked!

The full disc also prevented restarting MySQL. It stopped MySQL but it would not restart it no matter what I tried!


Though this solved your problem I doubt that this is what's causing the OP's problems. – slm Jun 26 '13 at 14:21

Just had this issue. If clearing Cookies and Cache as well as editing session variables does not work for you, give this a try:

chmod 777 -R /var/lib/php5/

Giving full access to read, write, and execute to PHP5 recursively fixed my problem. Again, this problem may have to do with permissions. Ubuntu can be quite deterministic in the way you have to allow permissions. I hope this may help, and if not, at least you can check it off.

I wanted to note that another problem, although it may be totally unrelated, is that after fixing this error, another error came from it. That was of course mcrypt extension not found error. If this occurs, check out this article for an immediate fix


There are a number of hints in other answers that mcrypt could be the culprit, but none explicitly give a solution. If you are unable to use cookie authentication, but config auth works, this may be for you. The following is based on Ubuntu 14.04 Desktop:

  1. Ensure you have php-mcrypt installed: sudo apt-get install php5-mcrypt
  2. Check the directory /etc/php5/apache2/conf.d for a symlink to mcrypt.ini (on some linux distributions, this will be just /etc/php5/conf.d).
  3. If no symlink exists, create it:

    sudo ln -s ../../mods-available/mcrypt.ini 20-mcrypt.ini

    where ../../mods-available/mcrypt.ini should be replaced with the correct relative link to mcrypt.ini (look at other symlinks in the directory for hints).

  4. Restart apache2:

    sudo service apache2 restart


Login fails if session folder in not writeable. To check that, create a PHP file in your web directory with:

$sessionPath = 'undefined';

if (!($sessionPath = ini_get('session.save_path'))) {
    $sessionPath = isset($_ENV['TMP']) ? $_ENV['TMP'] : sys_get_temp_dir();

if (!is_writeable($sessionPath)) {
    echo 'Session directory "'. $sessionPath . '"" is not writeable';
} else {
    echo 'Session directory: "' . $sessionPath . '" is writeable';

If session folder is not writeable do either

sudo setfacl -R -m u:www-data:rwx <session directory> or chmod 777 sudo setfacl -R -m u:www-data:rwx <session directory> -