Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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 http://windows.php.net/download/ or use the Web Platform Installer to install PHP.

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

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:

10.1.1.1 my.domain.name.tld

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 mydomain.com to the IP of the server.

share|improve this answer

Your Answer

 
discard

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.