2

I have PHP5.2.8 installed on IIS7, and it works fine for my default site (at C:\Inetpub\wwwroot).

Now, I need to run local copies of my company's sites on my machine, and each of those are directores in wwwroot. I have set each up on a separate port so I can just go to http://localhost:[portnum] to get to each.

If I try accessing a file, say: http://localhost:5002/test.php - I get a

"No input file specified.

" error. If I try it via http://localhost/Mysite.com/test.php it works fine. I am thinking it may have something to do with the doc_root setting in php.ini? I have it set to C:\Inetpub\wwwroot. I am running PHP as a FastCGI module.

Does anyone know a comprehensive tutorial or setting up PHP on IIS for a configuration like this? Or have any suggestions?

I am also wondering if I might get different results with it installed in ISAPI mode. Thoughts?

1 Answer 1

1

I think you are going about it the wrong way. If you going to run local copies of a site or different sites, you should establish them in different directories. Here's a very simple and straightforward process for setting up IIS 7 or 7.5. As long as you have PHP installed it will work for all sites.

Part 1

  1. Open up notepad.exe in administrative mode
  2. Locate your hosts file (C:\Windows\System32\drivers\etc) -[NOTE: No extension on hosts]
  3. Add another site IP / name like so:

Examples

#102.54.94.97    rhino.acme.com
127.0.0.1   localhost
127.0.0.2   testsite
127.0.0.3   testsite_etc

NOTE: If you are doing development testing you can leave off the .com and make up a name for use just like 'localhost'. The 'POUND' sign will comment out any lines.

Part 2

  1. Now add a new site (website) in IIS
  2. Name the site anything you want
  3. Select a folder where your website files are. (This is the root folder)
  4. Specify the IP address you added to the host's file (Example 127.0.0.2)
  5. For the hostname, specify the name you used in the host's file (testsite)
  6. Leave the port to 80, and http or https as needed for your site
  7. Make sure site is scheduled to start up by default.

NOTE Item 3 Above: This allows you to have sites in their own directories, It's a common misconception that you need to post all sites in inetpub/wwwroot/...

Part 3

Simply type in a browser address bar: testsite/ or 127.0.0.2/ and your site should load. If directory discover is off you'll also need to type out your default page... (E.G. testsite/index.php)

I've got a machine running 30 separate sites all using PHP to handle them from a single installation. The above example is for development testing, you can search for the differences when you go live for an IIS machine and need DNS forwarding to actual IP addresses.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.