Hello all,

I have a laptop running XP Pro. Also using web software called Front Accounting to handle my paperwork for small business. I installed by myself all the necessary software and have some experience using Apache / PHP / Mysql.

Brief description of problem:
I installed all the components Apache/php/mysql as per the documentation. Create a phpinfo(); script to test. And install phpmyadmin to configure database for web application. This is where things don't work so well.

Scenario A: If I am working away from internet access, say at a remote site, then the local webserver, mysql, front accounting all work fine. I get access through http://localhost/...

Scenario B: As soon as working from home or office where internet is connected (through wireless router) the localhost/phpmyadmin stops responding, I only get a blank page (No Errors). When I sever the connection to my wireless internet, the webpages will again respond properly.

I have a feeling it is hosts related so I check hosts file: file contains:
127.0.0.1 localhost

Current configuration:
Apache/2.2.15
PHP/5.3.2
MYSQL/5.1.46

Router configuration: I have exact same problem on three completely separate routers (Office=linksys, Home=dlink, Parents=dlink). Each router has its own dhcp server and my wireless IP address becomes something like as example. Network settings are basic dhcp settings (no proxy). Windows firewall is completely disabled. I have no firewall or anything unusual running that could interfere.

So I tried to access web through ...
Problem persists. Initial phpmyadmin screen comes up, but the as I enter the main database part the screen hangs.

I can work locally without internet and if I need something then turn internet on, but it's a complete pain. Without fail this is the difference: not connected to internet everything works fine, connect to internet it does not.

I need your help, oh experts! :)

Dani AI

Generated

Quick summary and root cause
The behavior you described (phpMyAdmin login page loads, then the browser shows “waiting for localhost” and the page goes blank only when the machine is on a network) points to a name-resolution / IP-stack mismatch between the client (PHP/browser) and the MySQL server. As suggested, phpMyAdmin can redirect or open a new connection using the hostname localhost. If that name resolves to the IPv6 loopback while MySQL is only listening on IPv4, the TCP connect will time out and the UI will hang. ’s final fix (removing the IPv6 entry) proves the cause, but it’s heavier than necessary.

Practical fixes (in order of least impact)

  • Force phpMyAdmin to use IPv4/TCP by editing its config and setting the server host to the numeric IPv4 address and the TCP connect type:
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
  • Make a minimal hosts-file change instead of uninstalling IPv6: edit the Windows hosts file (C:\Windows\System32\drivers\etc\hosts) with admin rights and ensure the IPv4 loopback is used for localhost (remove or comment any conflicting IPv6 localhost mapping).
  • Verify MySQL is listening where you expect: netstat -ano | findstr 3306 and try telnet 127.0.0.1 3306 (or use a TCP client) to confirm a fast connect. Use the browser DevTools Network tab to see which request actually stalls.

Notes and caution
Removing IPv6 from Windows is not recommended as a first step—it can break other services. The preferred approach is forcing IPv4 in your app or adjusting hosts/my.ini bind-address so php/PHP extensions and MySQL agree on the same loopback address. This preserves IPv6 for other uses while fixing phpMyAdmin hangs.

Recommended Answers

All 3 Replies

>>So I tried to access web through ...
>>Problem persists. Initial phpmyadmin screen comes up, but the
>> as I enter the main database part the screen hangs.

When you navigate to and click on a subsequent link is are you being redirected to or http://localhost/somePage . If the webserver is attempting to rewrite the URL with a bad hostname then this may cause issues.

Also can you explain your setup a little more? Do you have an XP laptop with a *nix virtual machine, or are you running windows binaries of apache/etc on XP?

I am using the Windows binaries on XP.

Some further observances:

Remember, this only happens while connected to the internet. When I go offline this does not occur.

Now, I enter the http://localhost/phpmydamin/index.php or this (Both resolve to their correct domains localhost or ). The login screen appears correctly which tells me that both Apache and PHP are working. This explains why my phpinfo.php script is also working.

However, when I enter my login info. the status of the browser goes to 'waiting for localhost' in the status bar, this takes quite some time. After which the screen goes blank and no further action can be taken. I am thinking now something to do with MYSQL. The database is not connecting through the ports correctly or something when the server has a valid IP address?

Just thinking aloud any help would be appreciated.

Justin

So I have solved this on my own!

I was able to repeat this problem on my home PC running Vista 64-bit edition. Installed all the server stuuf, got MySQL configured, and whammo same problem!

So I searche the forums and found out that my Vista uses IPv6, which is not supported in MySQL. Ironically I had the IPv6 protocal installed on my laptop for experimental reasons. On Vista it was a line in the HOSTS file(Comment out ::1 localhost)

After uninsalling the IPv6 protocol, my problem is gone. Thanks for all your efforts

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.