HowTo Fix: PhpMyAdmin Displays Blank Page After Logging In
August 16th, 2009 · Posted in HowTo, Tutorials

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.
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.

Recientemente publique un articulo acerca de Windows Vista Home Premium y los “problemillas” con los que me estaba encontrando al instalar ciertos programas. Bueno, en esta ocacion me tope con otro problema cuando instale appserv-win32-2.6.0 . Todo parecia funcionar bien, Apache estaba funcionando bien, pero cuando quise abrir PhpMyAdmin por alguna razon solo me mostraba una pagina en blanco luego de pedirme mi informacion de logeo.
La solucion a este problema de pagina blanca fue algo simple. Solo basto modificar esta linea en phpmyadmin/config.inc.php
$cfg['Servers'][$i]['host'] = 'localhost';
to this:
$cfg['Servers'][$i]['host'] = '127.0.0.1';
En el codigo de arriba, se esta cambiando el nombre de servidor a 127.0.0.1 con la finalidad de usar conexion TCP/IP . Luego de esto te sera posible ver tu pagina de PhpMyAdmin al abrir http://127.0.0.1/PhpMyAdmin en tu navegador.
Espero que este consejillo te haya sido util!
Nota: Siempre que especificas “localhost” o “localhost:port” como servidor, la libreria de MySQL sobreescribira esto y tratara de conectar a una soquete local (named pipe on Windows). So quieres usar TCP/IP, usa “127.0.0.1″ en lugar de “localhost”. Si la libreria MySQL trata de conectar a el soquete local incorrecto, entonces cambia la direccion correcta como Runtime Configuration en tu configuracion y deja el campo de servidor en blanco.





My name is Karina Myers, I'm a web designer & developer located in Michigan, US. This is one of my spaces on the web. I'm also the co-owner of Web Development/Design and Web Hosting Company 
September 27th, 2009 at 2:29 pm
Yes it helped … thank you
November 25th, 2009 at 7:40 am
man ….., pretty and smart
November 26th, 2009 at 6:08 am
Thanks a bunch. I struggled with this issue for an entire day
November 29th, 2009 at 9:54 am
just what I was looking for.. Thank you!
December 29th, 2009 at 4:21 am
[...] 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. [...]
December 30th, 2009 at 8:57 am
Wasted so many hours with that problem..you saved my day. Thanks a lot!
January 7th, 2010 at 3:29 pm
Thanks everybody! Nice comments like these make me want to create more useful post like this one.
Karina
January 21st, 2010 at 7:53 pm
Easy but great solution.
It works on windows 7 too.
Thanks a lot:)
January 23rd, 2010 at 10:53 am
Hell, I’ve been struggling with W7AMP & especially phpmyadmin for several hours now. Thank God & especially you for this blog
rgds
February 14th, 2010 at 4:53 pm
Thanks!!!
February 20th, 2010 at 11:34 am
short and simple. thanks
February 20th, 2010 at 3:33 pm
thank you, thank you, thank you .. after 6 hours of trying i finally found the solution
)) thank you very much!
February 24th, 2010 at 12:34 am
thank you very much Karina, you are a life savier
March 2nd, 2010 at 9:07 am
OMG, struggled for a whole day! Thanks a lot for this.
March 2nd, 2010 at 6:59 pm
after long and long hours searching on the internet and nothing
you finally solved my problem
Thanks !!
March 3rd, 2010 at 10:38 am
This solution will help. Thx to Karina. But try this configuaration:
$cfg['PmaAbsoluteUri'] = ‘http://localhost/phpmyadmin/’;
Now I can start phpMyAdmin with ‘localhost’.
Philipp
March 4th, 2010 at 1:52 am
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
March 4th, 2010 at 3:01 pm
very good advise:)
tks
March 5th, 2010 at 11:05 am
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!
March 6th, 2010 at 1:49 pm
You seriously are my hero!
March 7th, 2010 at 5:15 pm
Thanks a lot, it was very usefull!!!!
April 7th, 2010 at 8:40 am
Yeah!
First time Windows Apache / Mysql / PHP setup, i was stuck with this problem.
Thank You!
Great Work!
Great piece of advice!
May 5th, 2010 at 3:28 pm
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.
May 6th, 2010 at 2:42 pm
Thank you very much. This helped a lot.
May 14th, 2010 at 2:40 pm
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 !
May 14th, 2010 at 3:40 pm
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
May 16th, 2010 at 3:44 pm
Lifesaver!
May 23rd, 2010 at 6:49 pm
Phewwww! spent hours trying to figure this out, thanks!
June 2nd, 2010 at 12:32 am
I think phpmyadmin guys should have paid you for so useful information!
Muchas Gracias!!
June 17th, 2010 at 5:24 am
good blog, you deserve a free iPad: http://bit.ly/freeipad6
June 28th, 2010 at 2:45 pm
Thank you! Was racking my brain on this one.
July 14th, 2010 at 10:27 am
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?
July 15th, 2010 at 9:40 am
Fixed my problem right away. Thanks!
July 15th, 2010 at 12:04 pm
@Dark_eye: I know, right? haha. I’m glad this little PhpMyAdmin trick helped you. Come back anytime!
August 22nd, 2010 at 3:08 am
It was help. Thanks you so much