HowTo Fix: PhpMyAdmin Displays Blank Page After Logging In

phpmyadmin-vista

Recently I published an article about Windows Vista Home Premium and the “problems” I was running into when installing my programs. Well, this time I run into another problem when I installed appserv-win32-2.6.0 . Everything seemed to work just fine, Apache was working well, but when I tried opening PhpMyAdmin for some reason it was displaying a blank page after I entered my login information.

Method #1

The solution to this blank page problem is fairly easy. Simply modify this line in the phpmyadmin/config.inc.php

$cfg['Servers'][$i]['host']          = 'localhost';

to this:

$cfg['Servers'][$i]['host']          = '127.0.0.1';

In the above code, you’re changing your name server to 127.0.0.1 in order to use TCP/IP connection. After this, you should be able to see your PhpMyAdmin page by opening in your browser the address http://127.0.0.1/PhpMyAdmin

Hope this helps!

Note: Whenever you specify “localhost” or “localhost:port” as server, the MySQL client library will override this and try to connect to a local socket (named pipe on Windows). If you want to use TCP/IP, use “127.0.0.1” instead of “localhost”. If the MySQL client library tries to connect to the wrong local socket, you should set the correct path as Runtime Configuration in your PHP configuration and leave the server field blank.

UPDATE Dec 15, 2010:

Doing further research on this subject, this problem seems to be caused by a PHP bug #45150. The problem seems to be with Windows resolving localhost, more specifically localhost resolving to ::1 when IPv6 is enabled. If you have Windows Vista or Windows 7 it’s most likely you have IPV6 enabled by default.

Method #2

1. Go to Network Connections-> Properties and on local area connection->uncheck IPV6.

2.Open up \%windir%\system32\drivers\etc\ with a text editor and comment out this line:

::1 localhost

and prefix it:

#::1 localhost

This fix will help the loopback interface 127.0.0.1 point to localhost.

Save it and your PHP/MySQL connections will immediately begin working.

This is another way of fixing this problem. Both methods will work, but I’d recommend to follow this last method over the first one since it’s updated and it solves the localhost issue in a more efficient way now that we have detected the source of the problem.

Big thanks: to my readers Joberror, Adrian, Brandon and everyone else for your contributions.

62 thoughts on “HowTo Fix: PhpMyAdmin Displays Blank Page After Logging In

  1. Hell, I’ve been struggling with W7AMP & especially phpmyadmin for several hours now. Thank God & especially you for this blog 🙂

    rgds

  2. thank you, thank you, thank you .. after 6 hours of trying i finally found the solution :))) thank you very much!

  3. after long and long hours searching on the internet and nothing
    you finally solved my problem
    Thanks !!

  4. This solution will help. Thx to Karina. But try this configuaration:

    $cfg[‘PmaAbsoluteUri’] = ‘http://localhost/phpmyadmin/’;

    Now I can start phpMyAdmin with ‘localhost’.

    Philipp

  5. I spent about 12 hours trying to figure out a way out of this most irritating and frustrating problem. You saved my day and my weekend. Thank you so much! 🙂

  6. Yeah!

    First time Windows Apache / Mysql / PHP setup, i was stuck with this problem.
    Great Work!
    Great piece of advice!
    🙂 Thank You! 🙂

  7. That is a solution but doesn’t help in all situations for windows 7.
    the best way is to edit c:\windows\system32\drivers\etc\hosts file

    by uncommenting this line;

    127.0.0.1 localhost

    pucka! you are on the go….

    because easyphp wamp comes with 127.0.0.1 as default host for php… and it doesn’t work.

  8. i spent my entire day to fix this issue and in lack of ideas, googled it out and tried your solution.. and by magic .. it works ! owe you 🙂

    but i don’t understand why the loopback 127.0.0.1 aka localhost isn’t the same? it should be an alias specified in \etc\hosts .. never crossed my mind that could be the problem. Thanks !

  9. came back with other advices.

    Sorted it out: it’s all about ipv6 wich is enabled by default in newer windows versions(like vista,7).

    1.so, the fix sounds like this.. : network connections->properties on local area connection->uncheck IPV6 …(IPV6 it’s useless anyway for now. I don’t know any application that is using only ipv6 instead of clasic ipv4)

    2.go to \%windir%\system32\drivers\etc\ and edit “hosts” file in wich comment out this line: ::1 localhost like this.. #::1 localhost so that only the loopback interface 127.0.0.1 will point to localhost..

    It works perfectly right now. No more blank screens after phpmyadmin login.. no more .. token:string thing 😛

    thx again

  10. Apache and PHP installed on windows 7. tried to install phpmyadmin and after loging I get a page can not be displayed error in IE and Chrom. Did the above and that does not work. Any ideas?

  11. @Dark_eye: I know, right? haha. I’m glad this little PhpMyAdmin trick helped you. Come back anytime! 🙂

  12. Thanks, I actually ran into this before but with the amount of info one has to process these day I forgot about it. Just to stress, this solution will solve this problem, but you will run into other problems with other apps you may host if you don’t do what was suggested above by Joberror and Phillipp. Good lucking

  13. I am on Windows XP and your solution did not work for me. The problem exists on Windows XP as well, but probably for a different reason, since it simply did not work.

    Anyone else solved it on Win XP?

  14. Thanks a lot Karina!!!!

    I have been struggling with this for days now, read tons of forums, tried all sort of extensions in and out, but none got it right like you!!!

    Eres una crack!! 🙂

  15. Haha, gracias Felipe!
    I know exactly what you mean. I struggled so much whe I came across this problem, I knew I had to make a post about it, lol. I’m really glad to know this solution helped you. Stop by anytime! 🙂

    Karina Myers
    admin

  16. Thanks for the quick fix!
    I normally don’t comment. But this has wasted at least 2 hours of my time and I figured whats another couple minutes. I will admit your page is actually the first I looked at, but I wanted to know why this all of a sudden started to happen after my latest php upgrade. (it’s now two hours later) =)

    I found this in my search
    http://coreygilmore.com/blog/2009/11/20/fix-php-5-3-hang-on-windows/

    It basically reiterates the original fix by the brilliant Karina Myers and the comments that followed, but kinda alludes on who to blame. It seems to be a problem between php >= 5.3.0 and mysql. Apparently mysql wont support ipv6 until version 6 of mysql. I still don’t know why this only happens when I use php 5.3.0 or greater, but I am calling it quits.

    =)

  17. Hi Karina,
    Your suggestion totally saved my life….Almost!!!! It made it work for just a second. I was able to log into myPHPadmin and added a password. Once I did that, it brought me back to the log in page and regardless of what crazy combinations I came up with, its not logging me in again. The log in window just keeps popping up after I click “go”. Any suggestions? Thanks so much.

  18. The second version does not work anymore im Windows 2008 R2. The only way is to use 127.0.0.1

  19. I use win7 and after installing appserv, nothing happened when I run localhost. Trying your Method #1 and it worked.

    Thanks a lot Karina for these simple helpful tips.

    Rio Simanjuntak
    batam-indonesia

Comments are closed.