« Previous Next »

Thread: Questions about running PHP on IIS7

Last post 03-09-2009 7:42 AM by Aeries. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 04-28-2008, 5:58 PM

    • hellbird
    • Not Ranked
    • Joined on 04-28-2008, 9:49 PM
    • Posts 4

    Questions about running PHP on IIS7

    Hello, I'm trying to use PHP over FastCGI module in IIS7, but I have quite a lot of problems. So here are my questions:

     

    - How should I configure IIS, to execute PHP not only in .php files but also in .html, .htm, etc?
    - I've also installed WebDAV for IIS7 and there is another problem. When I try to edit some PHP files over WebDAV, I sometimes get error: "File doesn't exist!" I believe that I have configured something wrong, but I don't know what (maybe file gets locked, when someone is visiting the same file over www or when it is opened in more than just one editor at a time).
    - In most of my PHP files, I also get error 500 when I open them over www. What is usually causing this error when using PHP on IIS7? Is there a way to track the error?
     

     

    I hope you will understand my questions. 

     

    Thank you for help! 

     

    Best wishes!

     

  • 04-28-2008, 6:18 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,247

    Re: Questions about running PHP on IIS7

    You should probably start here to troubleshoot each issue individually.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 04-30-2008, 7:18 AM In reply to

    • hellbird
    • Not Ranked
    • Joined on 04-28-2008, 9:49 PM
    • Posts 4

    Re: Questions about running PHP on IIS7

    Thank you for your quick answer. Now I know how to see PHP errors. But still I don't know why, for example, when I do "find and replace" in Dreamweaver over the whole web site folder over WebDAV, I get error: "File doesn't exists!"

    So I'm still asking you, what is causing this error and also I would like to know how to configure IIS to execute PHP from not only in *.php files but also in *.html files. Thank you for your answers again!Best wishes,Marko

     

  • 04-30-2008, 2:24 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,247

    Re: Questions about running PHP on IIS7

    Using combination of IIS log file, detailed localhost errors and failed request tracing, you should be able to find more information about most errors.  For this particular error, I would start by looking in the IIS log file for error responses and if that does not give enough information, use failed request tracing to catch trace events for that request.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 03-09-2009, 7:42 AM In reply to

    • Aeries
    • Not Ranked
    • Joined on 03-09-2009, 7:22 AM
    • Posts 1

    Re: Questions about running PHP on IIS7

     Check out this guide,

    http://www.simongibson.com/intranet/php2003/

     Assuming you are running Vista SP1 or similar OS,

     

    1.  To enable php in .html files you need to add a new module handler, it's the exact same as the .php module handler except use the .htm extension, then make another for the .html extension.  

     At the server level click  (double click you're server name in the left tree) Handler Mappings,

     Next click add Modue Mapping on the right in the action pain,

    Request Path = *.htm

    Module= FastCgiModule

    Executable= SystemDrive\YourPHPFolder\php-cgi.exe (example c:\PHP\php-cgi.exe)

    Name = PHP in .Htm Via CGI (or whatever you want)

     

    Then do that again for the .html extension.  You can have multiple handlers for the same extension, I'm pretty sure you could get the php engine to parse asp files like this if you wanted to.


    As for WebDav and you're last error I'm not sure, but it took me 3 hours to figure out the above (insanely simple solution) and I see people asking about it everywhere, saying you're forced to use .php extensions, when you're not, it's so simple I felt like the worlds biggest idiot when I figured it out.
Page 1 of 1 (5 items)