Community Documentation

SimpleTest [Browser] on Vista

Last updated March 8, 2009. Created by awolfey on September 5, 2008.
Edited by boombatower, KingMoore. Log in to edit this page.

The Symptom

[Browser] based SimpleTests are failing when run on your localhost (or any system) running Windows Vista.

The Problem

Windows Vista has added a line to its hosts file that blocks SimpleTest's Browser from fetching pages via the following code in SimpleTest's socket.php file

    function _openSocket($host, $port, &$error_number, &$error, $timeout) {
        return @fsockopen($host, $port, $error_number, $error, $timeout);
    }

The Solution

1. Run notepad as Administrator (find the icon for notepad, right-click->run as Administrator)
2. Navigate to your hosts file (c:\windows\system32\drivers\etc\hosts)
3. Find the line that looks like:

::1             localhost

and remove it, or comment it out with a #

4. Restart apache
5. enjoy working SimpleTest [browser] tests

Comments

This should actually be moved

This should actually be moved to a general Drupal on Windows type section, because I'm pretty sure this also causes problems with drupal_http_request and other self-HTTP-request type things.

Some detail about the IPv6 localhost entry

I've done a bit of explanation about this on my blog: http://blog.riff.org/2008_11_22_speeding_up_drupal_on_vista_with_wampserver

Note that some ISPs (like Free in France, and probably others) have been actively deploying IPv6, so it may not always be appropriate to remove the IPv6 localhost entry that way.

nobody click here