日本好好热aⅴ|国产99视频精品免费观看|日本成人aV在线|久热香蕉国产在线

  • <cite id="ikgdy"><table id="ikgdy"></table></cite>
    1. 西西軟件園多重安全檢測(cè)下載網(wǎng)站、值得信賴(lài)的軟件下載站!
      軟件
      軟件
      文章
      搜索

      首頁(yè)編程開(kāi)發(fā)php教程 → Windows2003+IIS7 Express使用FastCgi運(yùn)行php

      Windows2003+IIS7 Express使用FastCgi運(yùn)行php

      相關(guān)軟件相關(guān)文章發(fā)表評(píng)論 來(lái)源:西西整理時(shí)間:2013/5/27 13:55:15字體大小:A-A+

      作者:西西點(diǎn)擊:101次評(píng)論:1次標(biāo)簽: IIS7

      • 類(lèi)型:系統(tǒng)其它大。174.5M語(yǔ)言:中文 評(píng)分:1.6
      • 標(biāo)簽:
      立即下載

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

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

      1、先修改:defaultDocument節(jié),加入 <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節(jié)。
      <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>配置節(jié)下,直接修改站點(diǎn)信息,或直接用appcmd.exe add site來(lái)添加站點(diǎn)。

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

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

      <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,直接雙擊運(yùn)行,或者用命令行來(lái)執(zhí)行指定加載哪個(gè)站點(diǎn).
      iisexpress.exe /site:'站點(diǎn)名稱(chēng)1"
      iisexpress.exe /site:'站點(diǎn)名稱(chēng)2"
      訪問(wèn)一下,就會(huì)發(fā)現(xiàn)訪問(wèn)速度比在windows下使用apache要快得多,而且少跑一個(gè)nginx,內(nèi)存占用整體上也少了很多。

        相關(guān)評(píng)論

        閱讀本文后您有什么感想? 已有人給出評(píng)價(jià)!

        • 8 喜歡喜歡
        • 3 頂
        • 1 難過(guò)難過(guò)
        • 5 囧
        • 3 圍觀圍觀
        • 2 無(wú)聊無(wú)聊

        熱門(mén)評(píng)論

        最新評(píng)論

        發(fā)表評(píng)論 查看所有評(píng)論(1)

        昵稱(chēng):
        表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
        字?jǐn)?shù): 0/500 (您的評(píng)論需要經(jīng)過(guò)審核才能顯示)