• <td id="ae6ms"><li id="ae6ms"></li></td>
  • <xmp id="ae6ms"><td id="ae6ms"></td><table id="ae6ms"></table>
  • <table id="ae6ms"></table>
  • <td id="ae6ms"></td>
    <td id="ae6ms"></td>
  • <table id="ae6ms"></table><table id="ae6ms"><td id="ae6ms"></td></table>
  • <td id="ae6ms"></td>
  • <table id="ae6ms"><li id="ae6ms"></li></table>
  • <table id="ae6ms"></table>
    西西軟件園多重安全檢測下載網站、值得信賴的軟件下載站!
    軟件
    軟件
    文章
    搜索

    首頁編程開發php教程 → Windows2003+IIS7 Express使用FastCgi運行php

    Windows2003+IIS7 Express使用FastCgi運行php

    相關軟件相關文章發表評論 來源:西西整理時間:2013/5/27 13:55:15字體大?。?em class="fontsize">A-A+

    作者:西西點擊:101次評論:1次標簽: IIS7

    • 類型:系統其它大?。?i>174.5M語言:中文 評分:1.6
    • 標簽:
    立即下載

    想在windows 2003中好好跑php,又要節省內存,真是很為難的事情,考慮到IIS7.5 Express可以在WIN2003上跑,不但能以fastcgi的方式支持php,還自帶Rewrite組件,只需簡單改改web.config的rule規則就可以了。

    于是下載了IIS7.5 Express后,安裝,還需要對applicationHost.config進行配置,首先得找到這個文件在哪里,如果能在"我的文檔"中IIS7Express目錄下找到,那就是它了,否則應該就是在IIS7 Express的安裝目錄下。

    1、先修改:defaultDocument節,加入 <add value="index.php" />
    <defaultDocument enabled="true">
    <files>
    <add value="Default.htm" />
    <add value="Default.asp" />
    <add value="index.htm" />
    <add value="index.html" />
    <add value="iisstart.htm" />
    <add value="default.aspx" />
    <add value="index.php" />
    </files>
    </defaultDocument>

    2、找到fastcgi節。
    <fastCgi>
    <application fullPath="C:\php\php-cgi.exe" monitorChangesTo="php.ini" activityTimeout="600" requestTimeout="600" instanceMaxRequests="10000">
    <environmentVariables>
    <environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
    <environmentVariable name="PHPRC" value="C:Program Files (x86)iis expressPHPv5.4" />
    </environmentVariables>
    </application>
    </fastCgi>

    3、找到handlles,加入
    <add name="PHP_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe" resourceType="Either" />
    尤其要注意的一是,這一句最好加在最前面,也就是在<handlles>下面的第一句,避免被其它Handle搶先處理了。

    以上配置中,C:\php\php-cgi.exe 的部分替換成自己的php文件夾中的php-cgi.exe的位置。

    4、在<site>配置節下,直接修改站點信息,或直接用appcmd.exe add site來添加站點。

    5、找到諸如wordpress的安裝文件夾,創建一個web.config文件,在configuration配置節下,添加Gzip壓縮規則。
    <system.webServer>
    <urlCompression doStaticCompression="true" doDynamicCompression="true" />
    </system.webServer>

    6、同樣在web.config中,Wordpress的rewrite完整的web.config文件內容如下:

    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="wordpress" patternSyntax="Wildcard">
    <match url="*" />
    <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Rewrite" url="index.php" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    <system.webServer>
    <urlCompression doStaticCompression="true" doDynamicCompression="true" />
    </system.webServer>
    </configuration>

    這樣就完全配置完畢了,然后在IIS7 Express目錄下,找到IISExpress.exe,直接雙擊運行,或者用命令行來執行指定加載哪個站點.
    iisexpress.exe /site:'站點名稱1"
    iisexpress.exe /site:'站點名稱2"
    訪問一下,就會發現訪問速度比在windows下使用apache要快得多,而且少跑一個nginx,內存占用整體上也少了很多。

      相關評論

      閱讀本文后您有什么感想? 已有人給出評價!

      • 8 喜歡喜歡
      • 3 頂
      • 1 難過難過
      • 5 囧
      • 3 圍觀圍觀
      • 2 無聊無聊

      熱門評論

      最新評論

      發表評論 查看所有評論(1)

      昵稱:
      表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
      字數: 0/500 (您的評論需要經過審核才能顯示)
      女人让男人桶30分钟免费视频,女人张开腿让男人桶个爽,一进一出又大又粗爽视频
    • <td id="ae6ms"><li id="ae6ms"></li></td>
    • <xmp id="ae6ms"><td id="ae6ms"></td><table id="ae6ms"></table>
    • <table id="ae6ms"></table>
    • <td id="ae6ms"></td>
      <td id="ae6ms"></td>
    • <table id="ae6ms"></table><table id="ae6ms"><td id="ae6ms"></td></table>
    • <td id="ae6ms"></td>
    • <table id="ae6ms"><li id="ae6ms"></li></table>
    • <table id="ae6ms"></table>