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.
Yes it helped … thank you
man ….., pretty and smart
Thanks a bunch. I struggled with this issue for an entire day 😀
just what I was looking for.. Thank you!
Wasted so many hours with that problem..you saved my day. Thanks a lot!
Thanks everybody! Nice comments like these make me want to create more useful post like this one. 🙂
Karina
Easy but great solution.
It works on windows 7 too.
Thanks a lot:)
Hell, I’ve been struggling with W7AMP & especially phpmyadmin for several hours now. Thank God & especially you for this blog 🙂
rgds
Thanks!!!
short and simple. thanks
thank you, thank you, thank you .. after 6 hours of trying i finally found the solution :))) thank you very much!
thank you very much Karina, you are a life savier
OMG, struggled for a whole day! Thanks a lot for this.
after long and long hours searching on the internet and nothing
you finally solved my problem
Thanks !!
This solution will help. Thx to Karina. But try this configuaration:
$cfg[‘PmaAbsoluteUri’] = ‘http://localhost/phpmyadmin/’;
Now I can start phpMyAdmin with ‘localhost’.
Philipp
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
very good advise:)
tks
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! 🙂
You seriously are my hero!
Thanks a lot, it was very usefull!!!!
Yeah!
First time Windows Apache / Mysql / PHP setup, i was stuck with this problem.
Great Work!
Great piece of advice!
🙂 Thank You! 🙂
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.
Thank you very much. This helped a lot.
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 !
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
Lifesaver!
Phewwww! spent hours trying to figure this out, thanks!
I think phpmyadmin guys should have paid you for so useful information!
Muchas Gracias!!
Thank you! Was racking my brain on this one.
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?
Fixed my problem right away. Thanks!
@Dark_eye: I know, right? haha. I’m glad this little PhpMyAdmin trick helped you. Come back anytime! 🙂
It was help. Thanks you so much 🙂
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
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?
I love you, man! I realy love you!!!
thanks guys…
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!! 🙂
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
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.
=)
yes, you are right.
it’s working after changed to 127.0.0.1
thank you very much.
Thanks for this – it help me out
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.
@zstoy, I just updated this post. Hopefully this second fix helps!
The second version does not work anymore im Windows 2008 R2. The only way is to use 127.0.0.1
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
Yes , It is Works, Thank you very much , I’m tired to found the right solutions. ^_^
Thanks, it’s nice.