HowTo Fix: PhpMyAdmin Displays Blank Page After Logging In

August 16th, 2009 · Posted in HowTo, Tutorials

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.

Share & Enjoy:
  • Digg
  • Facebook
  • del.icio.us
  • TwitThis
  • email
  • StumbleUpon

About the Author
My name is Karina Myers, I'm a web developer located in Michigan, US. To learn more about my work visit my portfolio, and services page. You may also contact me via email. I'd love to hear from you!
Did you enjoy this article?
karinamyers.com is a one person's operation. I try to make every article useful and well presented. Sometimes, writing an article can take weeks to just do the research and gather information. So, if you feel like returning the favor, buy me a cup of tea!

Tags: , ,

51 Responses to “HowTo Fix: PhpMyAdmin Displays Blank Page After Logging In”

  1. some random guy some random guy Says:

    Yes it helped … thank you

  2. some other random (good looking) guy some other random (good looking) guy Says:

    man ….., pretty and smart

  3. Lars Lars Says:

    Thanks a bunch. I struggled with this issue for an entire day :-D

  4. mik mik Says:

    just what I was looking for.. Thank you!

  5. mysql_connect to localhost on Windows 7 and Windows Vista times out | David’s Technical Musings mysql_connect to localhost on Windows 7 and Windows Vista times out | David’s Technical Musings Says:

    [...] Of course, I didn’t know that at the time as phpMyAdmin just displays a blank page.  I found this article by Karina Myers that described a workaround – specify 127.0.0.1 for the host instead of local host.  [...]

  6. michael michael Says:

    Wasted so many hours with that problem..you saved my day. Thanks a lot!

  7.  admin Says:

    Thanks everybody! Nice comments like these make me want to create more useful post like this one. :)
    Karina

  8. plusred plusred Says:

    Easy but great solution.
    It works on windows 7 too.
    Thanks a lot:)

  9. peter peter Says:

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

    rgds

  10. alsher alsher Says:

    Thanks!!!

  11. vern vern Says:

    short and simple. thanks

  12. jay jay Says:

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

  13. fani fani Says:

    thank you very much Karina, you are a life savier

  14. kevin kevin Says:

    OMG, struggled for a whole day! Thanks a lot for this.

  15. David David Says:

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

  16. Philipp Philipp Says:

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

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

    Now I can start phpMyAdmin with ‘localhost’.

    Philipp

  17. Philipp Philipp Says:

    Sorry, this shouldn’t be spam, but i think there is another solution, based on the note that karin write in her post. I have the problem with windows 7 and there was no host information in the file C:\Windows\System32\drivers\etc\hosts. Check this Link: http://www.windowsreference.com/windows-7/edit-hosts-file-in-windows-7-windows-vista/

    With the folling information in this file, localhost will work by connecting mysql:
    127.0.0.1 localhost

    Philipp

  18. james james Says:

    very good advise:)
    tks

  19. Venkat Venkat Says:

    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! :-)

  20. deep deep Says:

    You seriously are my hero!

  21. David David Says:

    Thanks a lot, it was very usefull!!!!

  22. Luca Luca Says:

    Yeah!

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

  23. Joberror Joberror Says:

    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.

  24. Michael Michael Says:

    Thank you very much. This helped a lot.

  25. Adrian Adrian Says:

    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 !

  26. Adrian Adrian Says:

    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 :P

    thx again

  27. Carl Carl Says:

    Lifesaver!

  28. erik erik Says:

    Phewwww! spent hours trying to figure this out, thanks!

  29. Dark_eye Dark_eye Says:

    I think phpmyadmin guys should have paid you for so useful information!

    Muchas Gracias!!

  30. Nathan Nathan Says:

    Thank you! Was racking my brain on this one.

  31. BIG AL BIG AL Says:

    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?

  32. Jerry Jerry Says:

    Fixed my problem right away. Thanks!

  33.  admin Says:

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

  34. Nimol Nimol Says:

    It was help. Thanks you so much :)

  35. hali hali Says:

    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

  36. John John Says:

    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?

  37. lani lani Says:

    I love you, man! I realy love you!!!

  38. Ajit Ajit Says:

    thanks guys…

  39. Felipe Felipe Says:

    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!! :)

  40.  admin Says:

    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

  41. Brandon Brandon Says:

    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.

    =)

  42. peter peter Says:

    yes, you are right.
    it’s working after changed to 127.0.0.1

    thank you very much.

  43. DK DK Says:

    Thanks for this – it help me out

  44. zstoy zstoy Says:

    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.

  45.  admin Says:

    @zstoy, I just updated this post. Hopefully this second fix helps!

  46. Solucion: PhpMyAdmin Muestra Pagina En Blanco Despues de Logeo | Karina Myers Solucion: PhpMyAdmin Muestra Pagina En Blanco Despues de Logeo | Karina Myers Says:

    [...] To read this article in English, click here. [...]

  47. AlexDe AlexDe Says:

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

  48. Rio Simanjuntak Rio Simanjuntak Says:

    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

  49. Abosami Abosami Says:

    Yes , It is Works, Thank you very much , I’m tired to found the right solutions. ^_^

  50. Narorm Mayoeurn Narorm Mayoeurn Says:

    Thanks, it’s nice.

  51. amar amar Says:

    thank you , its working

Leave a Reply

Related Posts Widget for Blogs by LinkWithin