Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have upgraded to a better spec Win Server 2008 R2 dedicated server.

This is due to have a the original domain pointed at it soon but cannot test the PHP files from locahost (or whatever the equivalent may be).

All the files are in wwwroot, however when testing on the server locally, the php files are just served as text rather than parsed by php. I'm not sure even where to start, but is there a way to view the contents of wwwroot as it it were live before pointing the DNS to the new server?

share|improve this question
up vote 3 down vote accepted

The fact that the content of your .php files is being echoed back to you suggests that the server isn't configured correctly, either:

  • You have yet to install PHP
  • Your server is configured to return .php files as plain text

If you need to install PHP, either go to or use the Web Platform Installer to install PHP.

If PHP is installed, but requires configuration, take a look at the installation instructions from

To answer the "view the contents of wwwroot as if it were live" section, you can setup additional "bindings" in IIS Manager to allow you to refer to the server without a DNS change, or you can make a change to your local hosts file (found in windows\system32\drivers\etc\hosts) by adding a line such as:

to the file. By specifying the IP address of the new server, along with the DNS name you wish to map to it, any requests from your PC to that domain name will be routed to the new IP address (Note: You may need to run ipconfig /flushdns from an administrative command prompt to ensure that your DNS cache is properly flushed. Also, close fully the browser you want to test in as some can be quite aggressive in caching DNS results).

share|improve this answer
Thanks, editing the hosts file was spot on... Allowed me see that mySQL wasn't installed on the new server. – Larry B Nov 16 '11 at 14:43

If you want to test your webpage to see how it will look live, you could edit the hosts file on a client to point to the IP of the server.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.